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

Added simple help description to the client CLI #1413

Merged
merged 3 commits into from
Apr 23, 2023

Conversation

JohannesNicholas
Copy link
Contributor

@JohannesNicholas JohannesNicholas commented Mar 27, 2023

Hi,
I made some mistakes with the previous pull request #1412
(I didn't realize it would keep up to date with my latest commits to my own fork.)

The following changes change the output help output of the command line.

Running python filesender.py --help currently will output:

usage: filesender.py [-h] [-v] [-i] [-p] [-s SUBJECT] [-m MESSAGE] [-g] [--threads THREADS] [--timeout TIMEOUT] [--retries RETRIES] -u USERNAME -a APIKEY -r RECIPIENTS files [files ...]

positional arguments:
  files                 path to file(s) to send

optional arguments:
  -h, --help            show this help message and exit
  -v, --verbose
  -i, --insecure
  -p, --progress
  -s SUBJECT, --subject SUBJECT
  -m MESSAGE, --message MESSAGE
  -g, --guest
  --threads THREADS
  --timeout TIMEOUT
  --retries RETRIES

required named arguments:
  -u USERNAME, --username USERNAME
  -a APIKEY, --apikey APIKEY
  -r RECIPIENTS, --recipients RECIPIENTS

With these changes, it outputs:

python filesender.py --help
usage: filesender.py [-h] [-v] [-i] [-p] [-s SUBJECT] [-m MESSAGE] [-g] [--threads THREADS] [--timeout TIMEOUT] [--retries RETRIES]
                    [-u USERNAME] [-a APIKEY] -r RECIPIENTS
                    files [files ...]

File Sender CLI client.
Source code: https://github.com/filesender/filesender/blob/master/scripts/client/filesender.py

positional arguments:
 files                 path to file(s) to send

options:
 -h, --help            show this help message and exit
 -v, --verbose
 -i, --insecure
 -p, --progress
 -s SUBJECT, --subject SUBJECT
 -m MESSAGE, --message MESSAGE
 -g, --guest
 --threads THREADS
 --timeout TIMEOUT
 --retries RETRIES
 -u USERNAME, --username USERNAME
 -a APIKEY, --apikey APIKEY

required named arguments:
 -r RECIPIENTS, --recipients RECIPIENTS

A config file can be added to C:\Users\Joey/.filesender/filesender.py.ini to avoid having to specify username and apikey on the command line.

Example (Config file is present): 
python filesender.py -r reciever@example.com file1.txt

@github-actions
Copy link

If there are selenium UI results for this code they will be at filesenderuici@2addac6

@madsi1m
Copy link
Contributor

madsi1m commented Mar 27, 2023

C:\Users\Joey/ ??

Source code: https://github.com/filesender/filesender/blob/master/scripts/client/filesender.py
'''),
epilog=textwrap.dedent(f'''\
A config file can be added to {homepath}/.filesender/filesender.py.ini to avoid having to specify username and apikey on the command line.
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

home path is inserted here

@JohannesNicholas
Copy link
Contributor Author

Yes, C:\Users\Joey is my home directory, yours will show up differently, see https://github.com/filesender/filesender/pull/1413/files#r1150366687

@monkeyiq
Copy link
Contributor

monkeyiq commented Apr 7, 2023

In the with these changes output I see that 'optional arguments' are listed twice?

@monkeyiq monkeyiq added the feedback-needed Please provide some more information so the bug can be found and resolved label Apr 14, 2023
@JohannesNicholas
Copy link
Contributor Author

My mistake, it must have been an error when copying the text over from the terminal. I've updated the description to include the actual output.

@monkeyiq monkeyiq merged commit 81831dc into filesender:development Apr 23, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feedback-needed Please provide some more information so the bug can be found and resolved
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants