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 usage text when missing options #295

Closed
mbkupfer opened this issue Dec 19, 2018 · 5 comments
Closed

Add usage text when missing options #295

mbkupfer opened this issue Dec 19, 2018 · 5 comments
Labels
Bug Something isn't working Fixed
Milestone

Comments

@mbkupfer
Copy link

Is your feature request related to a problem? Please describe.
Using onedrive with no options returns a nicely formatted usage text:

$ onedrive

--synchronize or --monitor missing from your command options or use --help for further assistance

No OneDrive sync will be performed without either of these two arguments being present

But, this isn't the case for some other inputs. For example, using --single-directory or --get-O365-drive-id without a value will provide a "missing value" error, but this is then followed by a long and unhelpful dump of code.

Describe the solution you'd like
Strip all code from the error message and just leave it at Missing value for argument <argument-name>.

Describe alternatives you've considered
N/A

Additional context

You can reproduce this using the following commands:
$ onedrive --get-O365-drive-id
$ onedrive --synchronize --single-directory

Output:

object.Exception@/home/mkupfer/dlang/dmd-2.083.1/linux/bin64/../../src/phobos/std/getopt.d(883): Missing value for argument --single-directory.
----------------
<very long dump of unreadable code below>
@abraunegg abraunegg added Bug Something isn't working In Progress Currently being worked on labels Dec 19, 2018
@abraunegg abraunegg added this to the 2.2.2 milestone Dec 19, 2018
@abraunegg
Copy link
Owner

abraunegg commented Dec 19, 2018

Same issue exists for:

--confdir

and potentially all other config options that require user 'input'

@abraunegg abraunegg added PR Provided - Needs Testing and removed In Progress Currently being worked on labels Dec 19, 2018
@abraunegg
Copy link
Owner

@mbkupfer
Can you please help test PR #299 to resolve this issue:

git clone https://github.com/abraunegg/onedrive.git
cd onedrive
git fetch origin pull/299/head:pr299
git checkout pr299
make
make install

@mbkupfer
Copy link
Author

Works for me.

@abraunegg
Copy link
Owner

PR #299 merged, closing as resolved

@lock
Copy link

lock bot commented Jan 5, 2019

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@lock lock bot locked and limited conversation to collaborators Jan 5, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Bug Something isn't working Fixed
Projects
None yet
Development

No branches or pull requests

2 participants