Skip to content

Commit 15291c0

Browse files
committed
Updated commandline
1 parent ae3b6c3 commit 15291c0

File tree

5 files changed

+16
-9
lines changed

5 files changed

+16
-9
lines changed

README.md

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@
44

55
Serve a file on local network and give the url in qrcode form on console
66

7+
For extra security provide a password `--password [password]`
8+
79
## Install
810

911
```bash
@@ -16,7 +18,7 @@ pip install qrshare
1618

1719
Press `Windows` + `r` and enter `shell:sendto`
1820

19-
> C:\Users\<user>\AppData\Roaming\Microsoft\Windows\SendTo
21+
> C:\Users\(user)\AppData\Roaming\Microsoft\Windows\SendTo
2022
2123
Create shortcut with command `qrshare` in folder
2224

@@ -29,11 +31,12 @@ qrshare --help
2931
```
3032

3133
```bash
32-
Usage: __main__.py [OPTIONS] PATH
34+
Usage: __main__.py [OPTIONS] PATHS...
3335

3436
Options:
35-
--port INTEGER waitress server port
36-
--help Show this message and exit.
37+
-p, --passcode TEXT when provided every device require authentication
38+
--port INTEGER waitress server port
39+
--help Show this message and exit.
3740
```
3841

3942
### Code Example

example.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,4 +11,5 @@
1111

1212
if __name__ == '__main__':
1313
app = App(paths)
14+
1415
app.serve(True)

qrshare/__init__.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
from .auth import Authentication
12
from .app import App
23

3-
__version__ = '0.3.1'
4+
__version__ = '0.3.2'

qrshare/__main__.py

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,17 @@
1-
import click
21
from pathlib import Path
32

3+
import click
4+
45
from qrshare import App
56

7+
68
@click.command()
79
@click.argument('paths', nargs=-1, required=True)
10+
@click.option('-p', '--password', type=str, help='when provided every device require authentication')
811
@click.option('--port', default=4000, type=int, help='waitress server port')
9-
def serve(paths, port):
12+
def serve(paths, password, port):
1013
try:
11-
app = App([Path(path).resolve() for path in paths], port)
14+
app = App([Path(path).resolve() for path in paths], password, port)
1215

1316
qr = app.qr
1417
print(qr.to_ascii(qr.string))

qrshare/app.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
from pathlib import Path
22
from typing import List
3-
from urllib.parse import unquote
43

54
import waitress
65
from flask import Flask, render_template, Markup, abort, send_file

0 commit comments

Comments
 (0)