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

Add command-line usage #47

Closed
goodmami opened this issue Nov 15, 2020 · 0 comments
Closed

Add command-line usage #47

goodmami opened this issue Nov 15, 2020 · 0 comments
Labels
enhancement New feature or request

Comments

@goodmami
Copy link
Owner

Some tasks, such as adding a new wordnet, are trivially done via the command line:

$ python -c 'import wn; wn.download("ewn:2020")'

But this isn't very user friendly:

  • The -c option to Python may be less well-known than -m
  • There's no argparse help for incorrect commands
  • Running a query like wn.synsets(...) won't print anything unless the user does print(wn.synsets(...))
  • Users must be careful about mixing quotes inside the string

Adding a __main__.py file with a basic command-line interface could help here. I'm not yet sold on making a wn command, as that's the name of the Princeton wordnet utility.

The command-line interface would be convenient with subcommands:

$ python -m wn download ewn:2020
$ python -m wn add ../odenet/odenet/wordnet/deWordNet.xml
$ python -m wn words --lgcode=en cat
$ python -m wn words --lgcode=en cat --translate=ja
@goodmami goodmami added the enhancement New feature or request label Nov 15, 2020
goodmami added a commit that referenced this issue Nov 26, 2020
Part of #47

Also adjust README formatting
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant