Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CLI arguments (sys.argv parsing) #6

Open
danilobellini opened this issue Apr 27, 2014 · 0 comments
Open

CLI arguments (sys.argv parsing) #6

danilobellini opened this issue Apr 27, 2014 · 0 comments
Assignees

Comments

@danilobellini
Copy link
Owner

Today, dose.py has a GUI configuration as well as a CLI command-line approach that allows a fast call like dose tox -v or dose "cat my_code.lang | my_interpreter.sh" and many things alike. However, parameters like the -v in that example are for the given command, not for dose, i.e., that means dose "tox -v".

A solution for giving CLI arguments for dose.py would be allowing them to happen BEFORE the command, which would be known based on the char "-" and from the context, e.g. dose.py --config dose.conf tox -v would mean:

  • Call dose.py directly and auto-start (because a command is given)
  • The call command is tox -v
  • Configuration file is dose.conf (where $HOME/.dose.conf would still be a fallback for "defaults" not explicitly written in the given alternative, though it should be kept unchanged).

This issue is to add the first CLI arguments for dose.py, allowing:

  • -h or --help for help
  • --config=CONFIG for setting up a specific configuration file (or directory, meaning a .dose.conf should be created there)
  • --size=SIZE for setting a initial window size like 200x200 (fractals CLI would help)
  • --position=POSITION, parsed like the size
  • --opacity=OPACITY, a value from 0 (transparent) to 255 (opaque)
  • --flip and --noflip to ensure whether image flipping should be done

So the configuration should have the following priority levels (for reading):

  1. CLI arguments
  2. Local config file, passed as --config or as a ./.dose.conf file
  3. User config file $HOME/.dose.conf
  4. Global defaults as "hardcoded" in dose.py
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants