GijsTimmers / kotnetcli

An easy automated way to log in on Kotnet.
GNU General Public License v3.0
5 stars 4 forks source link

Add a --license and --version flag #25

Closed jovanbulck closed 9 years ago

jovanbulck commented 9 years ago

Guest mode should be combinable with dialog for example This now auto starts curses:

if argumenten.guest_mode:
        ## werkt alleen met login op het moment
        print "ik wil me anders voordoen dan ik ben"
        cr = Credentials()
        gebruikersnaam, wachtwoord = cr.guest()
        co = communicator.CursesCommunicator()
        main(co, gebruikersnaam, wachtwoord)

Moreover, the credentials querying should also be passed to the communicaotor? This way the dialog communicator could ask the credentials via dialogs...

jovanbulck commented 9 years ago

e.g. --no-percentage-summary --show-motd --show-last-login-time

GijsTimmers commented 9 years ago

Guest mode should be combinable with dialog

This is something we need to work on, indeed. We should implement a decision tree with combinable and non-combinable options.

Moreover, the credentials querying should also be passed to the communicator?

That's an interesting idea. I'll look into it.

jovanbulck commented 9 years ago

These are the current option groups:

usage: kotnetcli.py [-h] [-i | -o | -1 | -0] [-k | -f | -g] [-c | -u | -t | -d | -b | -s | -q]

Actually --help should be mutually exclusive with all the other groups, I think.

The --help group then represents the group of options that cat some output and exit, without executing any of the kotnet logic. Other useful options in this group:

Don't know if its possible but the idea would be : (read '|' as inclusive OR )

usage: kotnetcli.py [-h -l -v] XOR [ [-i | -o | -1 | -0] | [-k | -f | -g] | [-c | -u | -t | -d | -b | -s | -q] ]

GijsTimmers commented 9 years ago

This is already the case. Try combining anything with the --help flag. You'll get no output except for the --help dialog.

jovanbulck commented 9 years ago

Indeed cool :-)

What about adding the other option ideas to this group?

The --help group then represents the group of options that cat some output and exit, without executing any of the kotnet logic. Other useful options in this group:

  • --license - display a summary of the CC license and a link to the full license
  • --version - cat the version number and maybe some other useful info of the platform
GijsTimmers commented 9 years ago

Yes, those will definitely be included. Do you know of a clean way to set the --version variable? I would rather not hardcode it.

jovanbulck commented 9 years ago

I'm afraid you'll have to hard code it in one single constant somewhere...

GijsTimmers commented 9 years ago

The --version flag is included now. The --licence flag will not be available for the time being, as it would require me to 'code around it': kotnetcli --licence -i would by default still log me in, for instance.

It's possible to fix that too by putting the --licence flag in the top of the decision tree, but that would make the program more complex. To me, it's not worth it at the moment.

9fce6d7d9713c9c79b147e864ceef270b83248e7