-
Notifications
You must be signed in to change notification settings - Fork 9
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
add cli prompt support for cirque home #6
Conversation
0a0cdc1
to
b149a09
Compare
./cirque/common/cirqueprompt.py:25:1: E302 expected 2 blank lines, found 1 |
b149a09
to
15bbb3e
Compare
cirque/common/cirqueprompt.py
Outdated
parser.add_argument('--base_image', type=str) | ||
parser.add_argument('--capability', type=str) | ||
parser.add_argument('--rcp_mode', action='store_true', default=False) | ||
parser.add_argument('--weave_config_file', type=str) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
create_device is generic CLI command, which should not have weave_config_file
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ack
|
||
|
||
class CirquePrompt(cmd.Cmd): | ||
prompt = 'cirque> ' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
please add help function
please add list homes
please add list devices
please add send_cmd which can send command to particular device.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
is there any chances that developer would create multiple homes locally?
help function, ack!
home_devces = list devices
run_exec = send_cmd
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'd also suggest to use prompt_toolkit
to read cli input which provides many fancy features such as history and reverse-i-search.
cirque/common/cirqueprompt.py
Outdated
'type': args.type, | ||
'base_image': args.base_image if args.base_image else None, | ||
'capability': capabilities, | ||
'rcp_mode': True if args.base_image else False, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
'rcp_mode': True if args.base_image else False, | |
'rcp_mode': True if args.rcp_mode else False, |
fe66d12
to
464be50
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Generally LGTM. A small lint issue.
06e8446
to
dd93a4a
Compare
Usage: cirque> create_home cirque> create_device --type wifi_ap cirque> create_device --type generic_node_image --capability WiFi,Thread,Interactive --rcp_mode cirque> device_state --device_id <device_id> cirque> close_device --device_id <device_id> cirque> homes (list all the homes) cirque> home_devices (list all the devices) cirque> run_exec --device_id <device_id> --command <command> (run command inside docker container) cirque> destroy_home cirque> version cirque> history cirque> exit Help: cirque> help Documented commands (use 'help -v' for verbose/'help <topic>' for details): =========================================================================== close_device create_home device_state help home_devices run_exec create_device destroy_home exit history homes version
dd93a4a
to
77d19f8
Compare
Usage:
cirque> create_home
cirque> create_device --type wifi_ap
cirque> create_device --type generic_node_image --capability WiFi,Thread,Interactive --rcp_mode
cirque> home_devices (list all the devices)
cirque> device_state --device_id <device_id>
cirque> run_exec --device_id <device_id> --command (run
command inside docker container)
cirque> close_device --device_id <device_id>
cirque> destroy_home