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

Sanic CLI upgrade #1962

Merged
merged 6 commits into from
Oct 25, 2020
Merged

Sanic CLI upgrade #1962

merged 6 commits into from
Oct 25, 2020

Conversation

ahopkins
Copy link
Member

@ahopkins ahopkins commented Oct 25, 2020

Fairly simple changes here:

  1. Add support for path.to.server:app as well as existing path.to.server.app
  2. Add a -v/--version to display Sanic version info
  3. Add some more help_text
  4. Add --access-logs/--no-access-logs
$ sanic -h
usage: sanic [-h] [-H HOST] [-p PORT] [-u UNIX] [--cert CERT] [--key KEY]
             [-w WORKERS] [--debug] [--access-logs | --no-access-logs] [-v]
             module

                 Sanic
         Build Fast. Run Fast.

positional arguments:
  module                path to your Sanic app. Example: path.to.server:app

optional arguments:
  -h, --help            show this help message and exit
  -H HOST, --host HOST  host address [default 127.0.0.1]
  -p PORT, --port PORT  port to serve on [default 8000]
  -u UNIX, --unix UNIX  location of unix socket
  --cert CERT           location of certificate for SSL
  --key KEY             location of keyfile for SSL.
  -w WORKERS, --workers WORKERS
                        number of worker processes [default 1]
  --debug
  --access-logs         display access logs
  --no-access-logs      no display access logs
  -v, --version         show program's version number and exit

@codecov
Copy link

codecov bot commented Oct 25, 2020

Codecov Report

Merging #1962 into master will decrease coverage by 0.03%.
The diff coverage is 90.90%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #1962      +/-   ##
==========================================
- Coverage   92.38%   92.34%   -0.04%     
==========================================
  Files          29       29              
  Lines        3242     3254      +12     
  Branches      571      572       +1     
==========================================
+ Hits         2995     3005      +10     
- Misses        169      170       +1     
- Partials       78       79       +1     
Impacted Files Coverage Δ
sanic/__main__.py 78.84% <90.90%> (+1.34%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update fd23b99...6a5c8be. Read the comment docs.

@ashleysommer
Copy link
Member

Looks great! Thanks!

@ashleysommer ashleysommer merged commit 5fbdcb6 into master Oct 25, 2020
@ahopkins ahopkins deleted the cli-upgrade branch October 26, 2020 04:01
@ahopkins ahopkins mentioned this pull request Dec 28, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants