JohnByrneRepo / mddir

Mddir generates a markdown file/folder structure for readme files
Other
215 stars 45 forks source link

added Flag functionality #14

Closed angelod1as closed 2 years ago

angelod1as commented 4 years ago

Making a few changes to add flag functionality.

I wanted to edit the indent information and ended up adding a --help and --verbose flag. That way, if the user types mmdir folder --help, the script is interrupted and the following message appears:

    HELP
      For detailed info and issue handling, visit source at https://github.com/JohnByrneRepo/mddir

      available flags:
        --help : this flag!
        --verbose : prints folder information
        --indent=2 : changes indentation at output file. Insert a number starting from 1.

      The script won't run with the --help flag.

The always on verbose setting bothered me, so I've implemented a --verbose flag as well. If you mddir folder --verbose, the script show all folders info. If not, a simple line logs that the script is running. Clean and neat.

I had to wrap almost the entire file in a run function, that's called at the end — that way any other script-ending functionalities can be added later.

If this propose is accepted, adding more ignored folders will be a breeze with a --ignored flag.

angelod1as commented 2 years ago

No interaction from maintainer.