Skip to content

quecot/qtree

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

qtree - A Fast and Customizable Directory Tree

qtree is a command-line tool for traversing and displaying directory structures. It provides output in multiple formats including plain text, JSON, and XML. Designed for flexibility, it can be easily integrated into various workflows to visualize directory hierarchies.

Features

  • Directory Traversal: Recursively traverses directories and lists their contents.
  • Output Formats: Supports output in plain text, JSON, and XML formats.
  • Customizable Output: Allows specification of output files and format via command-line arguments.
  • Error Handling: Provides informative error messages for common issues like file access errors.

Installation

Prerequisites

Ensure you have the following installed:

  • CMake 3.10 or later
  • A C compiler like clang

Build Instructions

  1. Clone the Repository:

    git clone https://github.com/quecot/qtree.git
    cd qtree
  2. Build the Project:

    mkdir build
    cd build
    cmake ..
    make
  3. Install (Optional):

    sudo make install

Usage

The qtree program is executed from the command line and provides various options for its operation. Below is a summary of the available options:

Usage: qtree [options] <directory>
Options:
-j, --json Output as JSON
-x, --xml Output as XML
-h, --help Show this help message
-v, --version Show version information
-o, --output Specify output file

Where:

  • <directory>: The path to the directory to be traversed.
  • -j, --json: Output the directory structure in JSON format.
  • -x, --xml: Output the directory structure in XML format.
  • -h, --help: Display the help message and exit.
  • -v, --version: Display version information and exit.
  • -o, --output <file>: Write the output to the specified file instead of the default stdout.

Example

qtree -j -o output.json /path/to/directory

This command will traverse /path/to/directory and output the directory structure in JSON format to output.json.

Development

Building from Source

Follow the Build Instructions to compile the project. The source code is organized with the main logic in src/main.c.

CMake Configuration

The project uses CMake for build configuration. The CMakeLists.txt file is configured to use clang as the compiler and clang-tidy for code quality checks. The build type defaults to Release.

License

This project is licensed under the MIT License. See the LICENSE file for more details.

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published