Giter Site home page Giter Site logo

ujjwall-r / dree Goto Github PK

View Code? Open in Web Editor NEW
66.0 66.0 16.0 147 KB

One single package for visualization, debugging, and exploration of folder hierarchies

Shell 7.36% C++ 89.12% Makefile 3.52%
developer-tools file-manager-cli hacktoberfest hacktoberfest-accepted hacktoberfest2023 makefile search

dree's Introduction

Hello World!

Ujjwal's Twitter Ujjwal's Linkdein Ujjwal's Github

GIF

I am Ujjwal R.

  • A self-taught Developer
  • A linux enthusiast
  • Hands on experience in several technology stacks
  • I love to learn and contribute in any and every possible way.
  • Do look into projects pinned to my profile and let me know if you find anything interesting.

Languages and Tools:

aws azure babel bash c cplusplus csharp django express flask git go heroku html5 javascript linux mariadb mocha mongodb mssql mysql nginx nodejs pandas postman pug puppeteer python pytorch react redux scikit_learn seaborn selenium sqlite tensorflow typescript webpack

ujjwall-r

dree's People

Contributors

abdelra6 avatar baguvix456 avatar faresatef1 avatar peachjelly13 avatar ruberald avatar ujjwall-r avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

dree's Issues

Missing feature: Add --help flag to the command

It would be great to have a --help flag passed with the dree command for better understanding of currently available command options supported.

Why is this useful?
Helpful for the first time users.

Documentation

Rewrite the readme.

  • Discuss a new readme format suitable
  • Uniform size images
  • create the planned format in a markdown file

Unit tests

Come up with plan of writing unit tests for already built methods.

Dependency rule violation

Navigate view is utilizing helper model which violates the dependency rule in context of architectural boundaries.

Update Readme.md with the -a flag

  • run the dree command with -a flag and update in the readme (the comparision with screenshots)
    run: dree 3

run: dree 3 -a

compare both

  • write instructions on how to add directories in .dreeignore
    If possible generate and add a single command for that

Filter UI

Remove unnecessary printings in terminal interface

Level UP : Directory Navigation using ncurses

Refer the below code.

#include <iostream>
#include <vector>
#include <string>
#include <ncurses.h>
#include <unistd.h>

struct MenuItem
{
    std::string text;
    std::string path;
};

void renderMenu(const std::vector<MenuItem> &menu, int selected)
{
    clear();
    for (int i = 0; i < menu.size(); ++i)
    {
        if (i == selected)
        {
            attron(A_REVERSE);
        }
        mvprintw(i + 1, 1, menu[i].text.c_str());
        attroff(A_REVERSE);
    }
    refresh();
}

int main()
{
    // Initialize ncurses
    initscr();
    cbreak();
    noecho();
    keypad(stdscr, TRUE);

    // Define menu items
    std::vector<MenuItem> menu = {
        {"Item 1", "/path1"},
        {"Item 2", "/path2"},
        {"Item 3", "/path3"},
        // Add more items as needed
    };

    int currentSelection = 0;
    int key;

    do
    {
        renderMenu(menu, currentSelection);

        key = getch();
        switch (key)
        {
        case KEY_UP:
            currentSelection = std::max(0, currentSelection - 1);
            break;
        case KEY_DOWN:
            currentSelection = std::min(static_cast<int>(menu.size() - 1), currentSelection + 1);
            break;
        case 10: // Enter key
            // Perform action associated with the selected item (change directory and exit)
            if (chdir(menu[currentSelection].path.c_str()) == 0)
            {
                endwin();                      // End ncurses mode before executing new shell
                execlp("zsh", "zsh", nullptr); // Start a new shell in the new directory
                std::cerr << "Error executing new shell." << std::endl;
                return 1;
            }
            else
            {
                std::cerr << "Error changing directory." << std::endl;
            }
            break;
        }
    } while (key != 27); // Exit when the user presses the Esc key

    // Cleanup
    endwin();

    return 0;
}

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.