Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
P
pycfhelpers
Manage
Activity
Members
Labels
Plan
Issues
0
Issue boards
Milestones
Wiki
Code
Merge requests
1
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
cellframe
python-cellframe-modules
pycfhelpers
Merge requests
!2
add cli optparse format
Code
Review changes
Check out branch
Download
Patches
Plain diff
Merged
add cli optparse format
add_cli
into
main
Overview
0
Commits
2
Pipelines
0
Changes
1
Merged
Evgeniy Yurchenko
requested to merge
add_cli
into
main
1 year ago
Overview
0
Commits
2
Pipelines
0
Changes
1
Expand
Add cli optparse format
👍
0
👎
0
Merge request reports
Compare
version 1
version 1
ddc58d67
1 year ago
main (base)
and
latest version
latest version
e7b95f00
2 commits,
1 year ago
version 1
ddc58d67
1 commit,
1 year ago
Show latest version
1 file
+
2
−
2
Inline
Compare changes
Side-by-side
Inline
Show whitespace changes
Show one file at a time
node/cli.py
+
2
−
2
Options
@@ -20,7 +20,7 @@ class CliCallback(Protocol):
pass
class
CF
AppCliServer
:
class
CF
CliCommand
:
def
__init__
(
self
,
command
:
str
,
callback
:
CliCallback
,
help_text
:
str
=
""
):
"""
Use https://docs.python.org/3.10/library/optparse.html, for configuration cli command
@@ -30,7 +30,7 @@ class CFAppCliServer:
self
.
help_text
=
help_text
self
.
parser
=
OptionParser
()
def
confirm
(
self
):
def
register
(
self
):
def
callback_wrapper
(
argv
:
list
[
str
],
reply_id
:
ReplyId
):
(
options
,
args
)
=
self
.
parser
.
parse_args
(
argv
[
1
:])
self
.
callback
(
*
args
,
reply_object
=
ReplyObject
(
reply_id
),
**
options
.
__dict__
)
Loading