Skip to content

Command line interface #2

Open
Open

Description

@techtonik

It would be extremely useful nice if this tool could provide a unified interactive command line interface across unix for most frequent commands.

For example, below is my typical session in unix environment (and the reason why I am here through PyPI) - I am trying to see a list of all human users on the system:

~# users
root
~# users -h
users: invalid option -- 'h'
Try `users --help' for more information.
~# users -help
users: invalid option -- 'h'
Try `users --help' for more information.
~# users -help
users: invalid option -- 'h'
Try `users --help' for more information.
~# users --help
Usage: users [OPTION]... [FILE]
Output who is currently logged in according to FILE.
If FILE is not specified, use /var/run/utmp.  /var/log/wtmp as FILE is common.

      --help     display this help and exit
      --version  output version information and exit

Report users bugs to bug-coreutils@gnu.org
GNU coreutils home page: <http://www.gnu.org/software/coreutils/>
General help using GNU software: <http://www.gnu.org/gethelp/>
Report users translation bugs to <http://translationproject.org/team/>
For complete documentation, run: info coreutils 'users invocation'
~# man users
...

And it is unsuccessful. What I'd expect is:

# pip install unix
# unix users
root
techtonik
# unix -h
unix users     --- list users
# unix users -h
unix users [--all]

options:
  --all   --- also list system users 

https://askubuntu.com/questions/257421/list-all-human-users

Activity

  1. fmenabe commented on Sep 21, 2015

    @fmenabe
    Owner

    This module aims (in disorder):

    • to provide an unified API across Unix systems for some basic operations (executing commands, manipulating files, ...)
    • to manage both localhost and remote host (via SSH) uniformly
    • for some operating systems (Linux, Solaris, *BSD, ...) implement specifics API
    • overload object for flexiblity (ex: host = Ubuntu(Linux(unix.Local()))). By using this system, it is possible to implement others APIs (ex: https://github.com/fmenabe/python-kvm, https://github.com/fmenabe/python-lxc)
    • order API elements (users, path, ...) in properties (ex: host.users.list(), host.path.exists('/tmp'))

    Exposing APIs with a command-line interface (or even a REPL) is a nice idea! But, from the goals of this module it may not be simple and, as you pointed out, I don't even had time to make the documentation ... So I don't think it will be done soon.

    Anyway, thanks for your contribution!

  2. techtonik commented on Sep 24, 2015

    @techtonik
    Author

    Well, with some effort being put into command line tool, I'd expect people to come up with PRs that close their immediate needs for the tool (and use / improve API as a result). Using API directly takes more time and effort, especially if it doesn't have docs. =)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions