Skip to content

Commit 3d84a0a

Browse files
nkpro2000srbessman
authored andcommitted
added cmdline
1 parent 09015ef commit 3d84a0a

File tree

2 files changed

+23
-1
lines changed

2 files changed

+23
-1
lines changed

PSL/cli.py

Lines changed: 20 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,8 @@
55
>>> from PSL import cli
66
>>> parser, subparser = cli.get_parser()
77
>>> cli.add_collect_args(subparser)
8-
>>> cli.add_wave_gen_args(subparser)
8+
>>> cli.add_wave_args(subparser)
9+
>>> cli.add_pwm_args(subparser)
910
>>> parser.parse_args(["collect","-i","logic_analyzer"])
1011
Namespace(channels=1, duration=1, file_path=None, function='collect',
1112
instrument='logic_analyzer', json=False, port=None)
@@ -468,3 +469,21 @@ def add_pwm_args(subparser: argparse._SubParsersAction):
468469
required=False,
469470
help="Set the state of SQ4",
470471
)
472+
473+
474+
def cmdline(args: List[str] = None):
475+
"""Command line for pslab.
476+
477+
Parameters
478+
----------
479+
args : list of strings.
480+
Arguments to parse.
481+
"""
482+
if args is None:
483+
args = sys.argv[1:]
484+
485+
parser, subparser = get_parser()
486+
add_collect_args(subparser)
487+
add_wave_args(subparser)
488+
add_pwm_args(subparser)
489+
main(parser.parse_args(args))

setup.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,9 @@
3131
"99-pslab.rules",
3232
]
3333
},
34+
entry_points = {
35+
'console_scripts': ['pslab=PSL.cli:cmdline'],
36+
},
3437
classifiers=[
3538
"Programming Language :: Python :: 3",
3639
"License :: OSI Approved :: GNU General Public License v3 (GPLv3)",

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy