

svcmgr="boot collector compliance create delete disable dns docker edit enable freeze frozen get logs migrate pg postsync presync print provision prstart prstatus prstop pull push resource restart resync run scheduler set shutdown start startapp startcontainer startdisk startfs startip startshare startstandby status stonith stop stopapp stopcontainer stopdisk stopfs stopip stopshare switch sync thaw unprovision unset update validate"
svcmgr_collector="ack alerts asset checks create disks events list log networks show tag untag"
svcmgr_collector_ack="action unavailability"
svcmgr_collector_create="tag"
svcmgr_collector_list="actions tags unavailability"
svcmgr_collector_list_unavailability="ack"
svcmgr_collector_show="actions tags"
svcmgr_compliance="attach auto check detach env fix fixable list show"
svcmgr_compliance_attach="moduleset ruleset"
svcmgr_compliance_detach="moduleset ruleset"
svcmgr_compliance_list="moduleset ruleset"
svcmgr_compliance_show="moduleset ruleset status"
svcmgr_dns="update"
svcmgr_edit="config"
svcmgr_pg="freeze kill thaw"
svcmgr_print="config devlist disklist resource schedule status"
svcmgr_print_config="mtime"
svcmgr_print_resource="status"
svcmgr_push="resinfo service"
svcmgr_push_service="status"
svcmgr_resource="monitor"
svcmgr_sync="all break drp establish full nodes quiesce restore resume resync revert split update verify"
svcmgr_validate="config"
svcmgr_set="--color --cron --daemon --debug --onlyprimary --onlysecondary --param --remote --status --value --waitlock -c --cluster -h --help -p --parallel -s --service"
svcmgr_unset="--color --cron --daemon --debug --onlyprimary --onlysecondary --param --remote --status --waitlock -c --cluster -h --help -p --parallel -s --service"
svcmgr_get="--color --cron --daemon --debug --eval --onlyprimary --onlysecondary --param --remote --status --waitlock -c --cluster -h --help -p --parallel -s --service"
svcmgr_edit_config="--color --cron --daemon --debug --discard --onlyprimary --onlysecondary --recover --remote --status --waitlock -c --cluster -h --help -p --parallel -s --service"
svcmgr_delete="--color --cron --daemon --debug --dry-run --master --onlyprimary --onlysecondary --remote --rid --slave --slaves --status --subsets --tags --unprovision --waitlock -c --cluster -f --force -h --help -p --parallel -s --service"
svcmgr_validate_config="--color --cron --daemon --debug --onlyprimary --onlysecondary --remote --status --waitlock -c --cluster -h --help -p --parallel -s --service"
svcmgr_create="--color --config --cron --daemon --debug --dry-run --env --master --onlyprimary --onlysecondary --provision --remote --resource --rid --slave --slaves --status --subsets --tags --template --waitlock -c --cluster -f --force -h --help -i --interactive -p --parallel -s --service"
svcmgr_print_config="--color --cron --daemon --debug --format --onlyprimary --onlysecondary --remote --status --waitlock -c --cluster -h --help -p --parallel -s --service"
svcmgr_update="--color --cron --daemon --debug --dry-run --master --onlyprimary --onlysecondary --provision --remote --resource --rid --slave --slaves --status --subsets --tags --waitlock -c --cluster -f --force -h --help -i --interactive -p --parallel -s --service"
svcmgr_compliance_list_ruleset="--color --cron --daemon --debug --onlyprimary --onlysecondary --remote --status --waitlock -c --cluster -h --help -p --parallel -s --service"
svcmgr_compliance_fixable="--attach --color --cron --daemon --debug --module --moduleset --onlyprimary --onlysecondary --remote --ruleset-date --status --waitlock -c --cluster -f --force -h --help -p --parallel -s --service"
svcmgr_compliance_list_moduleset="--color --cron --daemon --debug --onlyprimary --onlysecondary --remote --status --waitlock -c --cluster -h --help -p --parallel -s --service"
svcmgr_compliance_detach_moduleset="--color --cron --daemon --debug --moduleset --onlyprimary --onlysecondary --remote --status --waitlock -c --cluster -h --help -p --parallel -s --service"
svcmgr_compliance_fix="--attach --color --cron --daemon --debug --module --moduleset --onlyprimary --onlysecondary --remote --ruleset-date --status --waitlock -c --cluster -f --force -h --help -p --parallel -s --service"
svcmgr_compliance_attach_ruleset="--color --cron --daemon --debug --onlyprimary --onlysecondary --remote --ruleset --status --waitlock -c --cluster -h --help -p --parallel -s --service"
svcmgr_compliance_env="--color --cron --daemon --debug --module --moduleset --onlyprimary --onlysecondary --remote --status --waitlock -c --cluster -h --help -p --parallel -s --service"
svcmgr_compliance_detach="--color --cron --daemon --debug --moduleset --onlyprimary --onlysecondary --remote --ruleset --status --waitlock -c --cluster -h --help -p --parallel -s --service"
svcmgr_compliance_detach_ruleset="--color --cron --daemon --debug --onlyprimary --onlysecondary --remote --ruleset --status --waitlock -c --cluster -h --help -p --parallel -s --service"
svcmgr_compliance_check="--attach --color --cron --daemon --debug --module --moduleset --onlyprimary --onlysecondary --remote --ruleset-date --status --waitlock -c --cluster -f --force -h --help -p --parallel -s --service"
svcmgr_compliance_show_status="--color --cron --daemon --debug --onlyprimary --onlysecondary --remote --status --waitlock -c --cluster -h --help -p --parallel -s --service"
svcmgr_compliance_show_ruleset="--color --cron --daemon --debug --onlyprimary --onlysecondary --remote --status --waitlock -c --cluster -h --help -p --parallel -s --service"
svcmgr_compliance_attach="--color --cron --daemon --debug --moduleset --onlyprimary --onlysecondary --remote --ruleset --status --waitlock -c --cluster -h --help -p --parallel -s --service"
svcmgr_compliance_attach_moduleset="--color --cron --daemon --debug --moduleset --onlyprimary --onlysecondary --remote --status --waitlock -c --cluster -h --help -p --parallel -s --service"
svcmgr_compliance_show_moduleset="--color --cron --daemon --debug --onlyprimary --onlysecondary --remote --status --waitlock -c --cluster -h --help -p --parallel -s --service"
svcmgr_compliance_auto="--attach --color --cron --daemon --debug --module --moduleset --onlyprimary --onlysecondary --remote --ruleset-date --status --waitlock -c --cluster -f --force -h --help -p --parallel -s --service"
svcmgr_collector_disks="--color --cron --daemon --debug --format --onlyprimary --onlysecondary --remote --status --waitlock -c --cluster -h --help -p --parallel -s --service"
svcmgr_collector_log="--color --cron --daemon --debug --message --onlyprimary --onlysecondary --remote --status --waitlock -c --cluster -h --help -p --parallel -s --service"
svcmgr_collector_networks="--color --cron --daemon --debug --format --onlyprimary --onlysecondary --remote --status --waitlock -c --cluster -h --help -p --parallel -s --service"
svcmgr_collector_list_actions="--begin --color --cron --daemon --debug --end --format --onlyprimary --onlysecondary --remote --status --waitlock -c --cluster -h --help -p --parallel -s --service"
svcmgr_collector_checks="--color --cron --daemon --debug --format --onlyprimary --onlysecondary --remote --status --waitlock -c --cluster -h --help -p --parallel -s --service"
svcmgr_collector_tag="--color --cron --daemon --debug --onlyprimary --onlysecondary --remote --status --tag --waitlock -c --cluster -h --help -p --parallel -s --service"
svcmgr_collector_ack_unavailability="--account --author --begin --color --comment --cron --daemon --debug --duration --end --onlyprimary --onlysecondary --remote --status --waitlock -c --cluster -h --help -p --parallel -s --service"
svcmgr_collector_list_tags="--color --cron --daemon --debug --format --like --onlyprimary --onlysecondary --remote --status --waitlock -c --cluster -h --help -p --parallel -s --service"
svcmgr_collector_untag="--color --cron --daemon --debug --onlyprimary --onlysecondary --remote --status --tag --waitlock -c --cluster -h --help -p --parallel -s --service"
svcmgr_collector_show_actions="--begin --color --cron --daemon --debug --end --format --id --onlyprimary --onlysecondary --remote --status --waitlock -c --cluster -h --help -p --parallel -s --service"
svcmgr_collector_show_tags="--color --cron --daemon --debug --format --onlyprimary --onlysecondary --remote --status --waitlock -c --cluster -h --help -p --parallel -s --service"
svcmgr_collector_list_unavailability_ack="--author --begin --color --comment --cron --daemon --debug --end --onlyprimary --onlysecondary --remote --status --waitlock -c --cluster -h --help -p --parallel -s --service"
svcmgr_collector_create_tag="--color --cron --daemon --debug --onlyprimary --onlysecondary --remote --status --tag --waitlock -c --cluster -h --help -p --parallel -s --service"
svcmgr_collector_ack_action="--author --color --comment --cron --daemon --debug --onlyprimary --onlysecondary --remote --status --waitlock -c --cluster -h --help -p --parallel -s --service"
svcmgr_collector_alerts="--color --cron --daemon --debug --format --onlyprimary --onlysecondary --remote --status --waitlock -c --cluster -h --help -p --parallel -s --service"
svcmgr_collector_events="--begin --color --cron --daemon --debug --end --format --onlyprimary --onlysecondary --remote --status --waitlock -c --cluster -h --help -p --parallel -s --service"
svcmgr_collector_asset="--color --cron --daemon --debug --format --onlyprimary --onlysecondary --remote --status --waitlock -c --cluster -h --help -p --parallel -s --service"
svcmgr_prstatus="--color --cron --daemon --debug --onlyprimary --onlysecondary --remote --status --waitlock -c --cluster -h --help -p --parallel -s --service"
svcmgr_sync_update="--color --cron --daemon --debug --dry-run --master --onlyprimary --onlysecondary --remote --rid --slave --slaves --status --subsets --tags --waitlock -c --cluster -f --force -h --help -p --parallel -s --service"
svcmgr_logs="--color --cron --daemon --debug --onlyprimary --onlysecondary --remote --status --waitlock -c --cluster -h --help -p --parallel -s --service"
svcmgr_migrate="--color --cron --daemon --debug --disable-rollback --dry-run --ignore-affinity --master --onlyprimary --onlysecondary --remote --rid --slave --slaves --status --subsets --tags --to --waitlock -c --cluster -f --force -h --help -p --parallel -s --service"
svcmgr_print_resource_status="--color --cron --daemon --debug --format --onlyprimary --onlysecondary --refresh --remote --rid --status --waitlock -c --cluster -h --help -p --parallel -s --service"
svcmgr_presync="--color --cron --daemon --debug --dry-run --master --onlyprimary --onlysecondary --remote --rid --slave --slaves --status --subsets --tags --waitlock -c --cluster -f --force -h --help -p --parallel -s --service"
svcmgr_sync_resync="--color --cron --daemon --debug --dry-run --master --onlyprimary --onlysecondary --remote --rid --slave --slaves --status --subsets --tags --waitlock -c --cluster -f --force -h --help -p --parallel -s --service"
svcmgr_freeze="--color --cron --daemon --debug --onlyprimary --onlysecondary --remote --status --waitlock -c --cluster -h --help -p --parallel -s --service"
svcmgr_print_devlist="--color --cron --daemon --debug --format --onlyprimary --onlysecondary --remote --rid --status --subsets --tags --waitlock -c --cluster -h --help -p --parallel -s --service"
svcmgr_prstart="--color --cron --daemon --debug --disable-rollback --dry-run --ignore-affinity --master --onlyprimary --onlysecondary --remote --rid --slave --slaves --status --subsets --tags --waitlock -c --cluster -f --force -h --help -p --parallel -s --service"
svcmgr_print_config_mtime="--color --cron --daemon --debug --onlyprimary --onlysecondary --remote --status --waitlock -c --cluster -h --help -p --parallel -s --service"
svcmgr_resync="--color --cron --daemon --debug --disable-rollback --dry-run --ignore-affinity --master --onlyprimary --onlysecondary --remote --rid --slave --slaves --status --subsets --tags --waitlock -c --cluster -f --force -h --help -p --parallel -s --service"
svcmgr_shutdown="--color --cron --daemon --debug --dry-run --master --onlyprimary --onlysecondary --remote --rid --slave --slaves --status --subsets --tags --waitlock -c --cluster -f --force -h --help -p --parallel -s --service"
svcmgr_stopshare="--color --cron --daemon --debug --dry-run --master --onlyprimary --onlysecondary --remote --rid --slave --slaves --status --subsets --tags --waitlock -c --cluster -f --force -h --help -p --parallel -s --service"
svcmgr_run="--color --cron --daemon --debug --dry-run --master --onlyprimary --onlysecondary --remote --rid --slave --slaves --status --subsets --tags --waitlock -c --cluster -f --force -h --help -p --parallel -s --service"
svcmgr_startfs="--color --cron --daemon --debug --disable-rollback --dry-run --ignore-affinity --master --onlyprimary --onlysecondary --remote --rid --slave --slaves --status --subsets --tags --waitlock -c --cluster -f --force -h --help -p --parallel -s --service"
svcmgr_sync_revert="--color --cron --daemon --debug --dry-run --master --onlyprimary --onlysecondary --remote --rid --slave --slaves --status --subsets --tags --waitlock -c --cluster -f --force -h --help -p --parallel -s --service"
svcmgr_push_service_status="--color --cron --daemon --debug --onlyprimary --onlysecondary --remote --status --waitlock -c --cluster -h --help -p --parallel -s --service"
svcmgr_stonith="--color --cron --daemon --debug --dry-run --master --onlyprimary --onlysecondary --remote --rid --slave --slaves --status --subsets --tags --waitlock -c --cluster -f --force -h --help -p --parallel -s --service"
svcmgr_push_resinfo="--color --cron --daemon --debug --onlyprimary --onlysecondary --remote --status --waitlock -c --cluster -h --help -p --parallel -s --service"
svcmgr_stopip="--color --cron --daemon --debug --dry-run --master --onlyprimary --onlysecondary --remote --rid --slave --slaves --status --subsets --tags --waitlock -c --cluster -f --force -h --help -p --parallel -s --service"
svcmgr_sync_drp="--color --cron --daemon --debug --dry-run --master --onlyprimary --onlysecondary --remote --rid --slave --slaves --status --subsets --tags --waitlock -c --cluster -f --force -h --help -p --parallel -s --service"
svcmgr_sync_nodes="--color --cron --daemon --debug --dry-run --master --onlyprimary --onlysecondary --remote --rid --slave --slaves --status --subsets --tags --waitlock -c --cluster -f --force -h --help -p --parallel -s --service"
svcmgr_prstop="--color --cron --daemon --debug --dry-run --master --onlyprimary --onlysecondary --remote --rid --slave --slaves --status --subsets --tags --waitlock -c --cluster -f --force -h --help -p --parallel -s --service"
svcmgr_boot="--color --cron --daemon --debug --disable-rollback --dry-run --ignore-affinity --master --onlyprimary --onlysecondary --remote --rid --slave --slaves --status --subsets --tags --waitlock -c --cluster -f --force -h --help -p --parallel -s --service"
svcmgr_switch="--color --cron --daemon --debug --disable-rollback --dry-run --ignore-affinity --master --onlyprimary --onlysecondary --remote --rid --slave --slaves --status --subsets --tags --to --waitlock -c --cluster -f --force -h --help -p --parallel -s --service"
svcmgr_start="--color --cron --daemon --debug --disable-rollback --dry-run --ignore-affinity --master --onlyprimary --onlysecondary --remote --rid --slave --slaves --status --subsets --tags --waitlock -c --cluster -f --force -h --help -p --parallel -s --service"
svcmgr_sync_break="--color --cron --daemon --debug --dry-run --master --onlyprimary --onlysecondary --remote --rid --slave --slaves --status --subsets --tags --waitlock -c --cluster -f --force -h --help -p --parallel -s --service"
svcmgr_sync_resume="--color --cron --daemon --debug --dry-run --master --onlyprimary --onlysecondary --remote --rid --slave --slaves --status --subsets --tags --waitlock -c --cluster -f --force -h --help -p --parallel -s --service"
svcmgr_sync_all="--color --cron --daemon --debug --dry-run --master --onlyprimary --onlysecondary --remote --rid --slave --slaves --status --subsets --tags --waitlock -c --cluster -f --force -h --help -p --parallel -s --service"
svcmgr_status="--color --cron --daemon --debug --onlyprimary --onlysecondary --refresh --remote --status --waitlock -c --cluster -h --help -p --parallel -s --service"
svcmgr_dns_update="--color --cron --daemon --debug --dry-run --master --onlyprimary --onlysecondary --remote --rid --slave --slaves --status --subsets --tags --waitlock -c --cluster -f --force -h --help -p --parallel -s --service"
svcmgr_print_status="--color --cron --daemon --debug --format --hide-disabled --onlyprimary --onlysecondary --refresh --remote --show-disabled --status --waitlock -c --cluster -h --help -p --parallel -s --service"
svcmgr_enable="--color --cron --daemon --debug --onlyprimary --onlysecondary --remote --rid --status --subsets --tags --waitlock -c --cluster -h --help -p --parallel -s --service"
svcmgr_thaw="--color --cron --daemon --debug --onlyprimary --onlysecondary --remote --status --waitlock -c --cluster -h --help -p --parallel -s --service"
svcmgr_print_disklist="--color --cron --daemon --debug --format --onlyprimary --onlysecondary --remote --rid --status --subsets --tags --waitlock -c --cluster -h --help -p --parallel -s --service"
svcmgr_resource_monitor="--color --cron --daemon --debug --dry-run --master --onlyprimary --onlysecondary --remote --rid --slave --slaves --status --subsets --tags --waitlock -c --cluster -f --force -h --help -p --parallel -s --service"
svcmgr_stopcontainer="--color --cron --daemon --debug --dry-run --master --onlyprimary --onlysecondary --remote --rid --slave --slaves --status --subsets --tags --waitlock -c --cluster -f --force -h --help -p --parallel -s --service"
svcmgr_pg_thaw="--color --cron --daemon --debug --dry-run --master --onlyprimary --onlysecondary --remote --rid --slave --slaves --status --subsets --tags --waitlock -c --cluster -f --force -h --help -p --parallel -s --service"
svcmgr_stop="--color --cron --daemon --debug --dry-run --master --onlyprimary --onlysecondary --remote --rid --slave --slaves --status --subsets --tags --waitlock -c --cluster -f --force -h --help -p --parallel -s --service"
svcmgr_sync_restore="--color --cron --daemon --debug --dry-run --master --onlyprimary --onlysecondary --remote --rid --slave --slaves --status --subsets --tags --waitlock -c --cluster -f --force -h --help -p --parallel -s --service"
svcmgr_startstandby="--color --cron --daemon --debug --disable-rollback --dry-run --ignore-affinity --master --onlyprimary --onlysecondary --remote --rid --slave --slaves --status --subsets --tags --waitlock -c --cluster -f --force -h --help -p --parallel -s --service"
svcmgr_push="--color --cron --daemon --debug --onlyprimary --onlysecondary --remote --status --waitlock -c --cluster -h --help -p --parallel -s --service"
svcmgr_disable="--color --cron --daemon --debug --onlyprimary --onlysecondary --remote --rid --status --subsets --tags --waitlock -c --cluster -h --help -p --parallel -s --service"
svcmgr_unprovision="--color --cron --daemon --debug --dry-run --master --onlyprimary --onlysecondary --remote --rid --slave --slaves --status --subsets --tags --waitlock -c --cluster -f --force -h --help -p --parallel -s --service"
svcmgr_scheduler="--color --cron --daemon --debug --onlyprimary --onlysecondary --remote --status --waitlock -c --cluster -h --help -p --parallel -s --service"
svcmgr_stopdisk="--color --cron --daemon --debug --dry-run --master --onlyprimary --onlysecondary --remote --rid --slave --slaves --status --subsets --tags --waitlock -c --cluster -f --force -h --help -p --parallel -s --service"
svcmgr_stopfs="--color --cron --daemon --debug --dry-run --master --onlyprimary --onlysecondary --remote --rid --slave --slaves --status --subsets --tags --waitlock -c --cluster -f --force -h --help -p --parallel -s --service"
svcmgr_provision="--color --cron --daemon --debug --disable-rollback --dry-run --ignore-affinity --master --onlyprimary --onlysecondary --remote --rid --slave --slaves --status --subsets --tags --waitlock -c --cluster -f --force -h --help -p --parallel -s --service"
svcmgr_restart="--color --cron --daemon --debug --disable-rollback --dry-run --ignore-affinity --master --onlyprimary --onlysecondary --remote --rid --slave --slaves --status --subsets --tags --waitlock -c --cluster -f --force -h --help -p --parallel -s --service"
svcmgr_startcontainer="--color --cron --daemon --debug --disable-rollback --dry-run --ignore-affinity --master --onlyprimary --onlysecondary --remote --rid --slave --slaves --status --subsets --tags --waitlock -c --cluster -f --force -h --help -p --parallel -s --service"
svcmgr_pull="--color --cron --daemon --debug --onlyprimary --onlysecondary --provision --remote --status --waitlock -c --cluster -h --help -p --parallel -s --service"
svcmgr_sync_split="--color --cron --daemon --debug --dry-run --master --onlyprimary --onlysecondary --remote --rid --slave --slaves --status --subsets --tags --waitlock -c --cluster -f --force -h --help -p --parallel -s --service"
svcmgr_stopapp="--color --cron --daemon --debug --dry-run --master --onlyprimary --onlysecondary --remote --rid --slave --slaves --status --subsets --tags --waitlock -c --cluster -f --force -h --help -p --parallel -s --service"
svcmgr_startshare="--color --cron --daemon --debug --disable-rollback --dry-run --ignore-affinity --master --onlyprimary --onlysecondary --remote --rid --slave --slaves --status --subsets --tags --waitlock -c --cluster -f --force -h --help -p --parallel -s --service"
svcmgr_startip="--color --cron --daemon --debug --disable-rollback --dry-run --ignore-affinity --master --onlyprimary --onlysecondary --remote --rid --slave --slaves --status --subsets --tags --waitlock -c --cluster -f --force -h --help -p --parallel -s --service"
svcmgr_sync_establish="--color --cron --daemon --debug --dry-run --master --onlyprimary --onlysecondary --remote --rid --slave --slaves --status --subsets --tags --waitlock -c --cluster -f --force -h --help -p --parallel -s --service"
svcmgr_startapp="--color --cron --daemon --debug --disable-rollback --dry-run --ignore-affinity --master --onlyprimary --onlysecondary --remote --rid --slave --slaves --status --subsets --tags --waitlock -c --cluster -f --force -h --help -p --parallel -s --service"
svcmgr_sync_quiesce="--color --cron --daemon --debug --dry-run --master --onlyprimary --onlysecondary --remote --rid --slave --slaves --status --subsets --tags --waitlock -c --cluster -f --force -h --help -p --parallel -s --service"
svcmgr_sync_verify="--color --cron --daemon --debug --dry-run --master --onlyprimary --onlysecondary --remote --rid --slave --slaves --status --subsets --tags --waitlock -c --cluster -f --force -h --help -p --parallel -s --service"
svcmgr_frozen="--color --cron --daemon --debug --onlyprimary --onlysecondary --remote --status --waitlock -c --cluster -h --help -p --parallel -s --service"
svcmgr_startdisk="--color --cron --daemon --debug --disable-rollback --dry-run --ignore-affinity --master --onlyprimary --onlysecondary --remote --rid --slave --slaves --status --subsets --tags --waitlock -c --cluster -f --force -h --help -p --parallel -s --service"
svcmgr_postsync="--color --cron --daemon --debug --dry-run --master --onlyprimary --onlysecondary --remote --rid --slave --slaves --status --subsets --tags --waitlock -c --cluster -f --force -h --help -p --parallel -s --service"
svcmgr_pg_kill="--color --cron --daemon --debug --dry-run --master --onlyprimary --onlysecondary --remote --rid --slave --slaves --status --subsets --tags --waitlock -c --cluster -f --force -h --help -p --parallel -s --service"
svcmgr_sync_full="--color --cron --daemon --debug --dry-run --master --onlyprimary --onlysecondary --remote --rid --slave --slaves --status --subsets --tags --waitlock -c --cluster -f --force -h --help -p --parallel -s --service"
svcmgr_print_schedule="--color --cron --daemon --debug --format --onlyprimary --onlysecondary --remote --status --verbose --waitlock -c --cluster -h --help -p --parallel -s --service"
svcmgr_docker="--color --cron --daemon --debug --onlyprimary --onlysecondary --remote --status --waitlock -c --cluster -h --help -p --parallel -s --service"
svcmgr_pg_freeze="--color --cron --daemon --debug --dry-run --master --onlyprimary --onlysecondary --remote --rid --slave --slaves --status --subsets --tags --waitlock -c --cluster -f --force -h --help -p --parallel -s --service"
nodemgr="array checks collect collector compliance dequeue discover edit get logs print prkey pushasset pushbrocade pushcentera pushdcs pushdisks pushemcvnx pusheva pushfreenas pushgcedisks pushhds pushhp3par pushibmds pushibmsvc pushnecism pushnetapp pushnsr pushpatch pushpkg pushstats pushsym pushvioserver pushxtremio reboot register rotate scanscsi schedule scheduler schedulers set shutdown sysreport unschedule unset updatecomp updatepkg wol"
nodemgr_collect="stats"
nodemgr_collector="ack alerts asset checks cli create disks events list log networks search show tag untag"
nodemgr_collector_ack="action"
nodemgr_collector_create="tag"
nodemgr_collector_list="actions filtersets nodes services tags"
nodemgr_collector_show="actions tags"
nodemgr_compliance="attach auto check detach env fix fixable list show"
nodemgr_compliance_attach="moduleset ruleset"
nodemgr_compliance_detach="moduleset ruleset"
nodemgr_compliance_list="module moduleset ruleset"
nodemgr_compliance_show="moduleset ruleset status"
nodemgr_dequeue="actions"
nodemgr_edit="authconfig config"
nodemgr_print="authconfig config schedule"
nodemgr_rotate="root"
nodemgr_rotate_root="pw"
nodemgr_schedule="reboot"
nodemgr_schedule_reboot="status"
nodemgr_unschedule="reboot"
nodemgr_pushnsr="--color --cron --debug --format --object -h --help"
nodemgr_pushcentera="--color --cron --debug --format --object -h --help"
nodemgr_pushibmds="--color --cron --debug --format --object -h --help"
nodemgr_pushhp3par="--color --cron --debug --format --object -h --help"
nodemgr_pushxtremio="--color --cron --debug --format --object -h --help"
nodemgr_pushpatch="--color --cron --debug --format -h --help"
nodemgr_pushpkg="--color --cron --debug --format -h --help"
nodemgr_pushvioserver="--color --cron --debug --format --object -h --help"
nodemgr_pushasset="--color --cron --debug --format --sync -h --help"
nodemgr_pushibmsvc="--color --cron --debug --format --object -h --help"
nodemgr_pushnetapp="--color --cron --debug --format --object -h --help"
nodemgr_pushgcedisks="--color --cron --debug --format --object -h --help"
nodemgr_pusheva="--color --cron --debug --format --object -h --help"
nodemgr_pushnecism="--color --cron --debug --format --object -h --help"
nodemgr_pushdcs="--color --cron --debug --format --object -h --help"
nodemgr_pushbrocade="--color --cron --debug --format --object -h --help"
nodemgr_sysreport="--color --cron --debug --format -h --help"
nodemgr_pushemcvnx="--color --cron --debug --format --object -h --help"
nodemgr_pushfreenas="--color --cron --debug --format --object -h --help"
nodemgr_pushhds="--color --cron --debug --format --object -h --help"
nodemgr_pushstats="--begin --color --cron --debug --end --format --stats-dir -h --help"
nodemgr_pushsym="--color --cron --debug --format --object --symcli-db-file -h --help"
nodemgr_checks="--color --cron --debug --format -h --help"
nodemgr_pushdisks="--color --cron --debug --format -h --help"
nodemgr_compliance_list_ruleset="--color --cron --debug --format -h --help"
nodemgr_compliance_fixable="--attach --color --cron --debug --force --format --module --moduleset --ruleset-date -h --help"
nodemgr_compliance_list_moduleset="--color --cron --debug --format -h --help"
nodemgr_compliance_detach_moduleset="--color --cron --debug --format --moduleset -h --help"
nodemgr_compliance_detach_ruleset="--color --cron --debug --format --ruleset -h --help"
nodemgr_compliance_fix="--attach --color --cron --debug --force --format --module --moduleset --ruleset-date -h --help"
nodemgr_compliance_list_module="--color --cron --debug --format -h --help"
nodemgr_compliance_env="--color --cron --debug --format --module --moduleset -h --help"
nodemgr_compliance_detach="--color --cron --debug --format --moduleset --ruleset -h --help"
nodemgr_compliance_attach="--color --cron --debug --format --moduleset --ruleset -h --help"
nodemgr_compliance_attach_ruleset="--color --cron --debug --format --ruleset -h --help"
nodemgr_compliance_check="--attach --color --cron --debug --force --format --module --moduleset --ruleset-date -h --help"
nodemgr_compliance_show_status="--color --cron --debug --format -h --help"
nodemgr_compliance_show_ruleset="--color --cron --debug --format -h --help"
nodemgr_compliance_attach_moduleset="--color --cron --debug --format --moduleset -h --help"
nodemgr_compliance_show_moduleset="--color --cron --debug --format -h --help"
nodemgr_compliance_auto="--color --cron --debug --format -h --help"
nodemgr_prkey="--color --cron --debug --format -h --help"
nodemgr_collector_list_tags="--color --cron --debug --format --like -h --help"
nodemgr_collector_disks="--color --cron --debug --format -h --help"
nodemgr_collector_log="--color --cron --debug --format --message -h --help"
nodemgr_collector_events="--begin --color --cron --debug --end --format -h --help"
nodemgr_collector_search="--color --cron --debug --format --like -h --help"
nodemgr_collector_list_filtersets="--color --cron --debug --format -h --help"
nodemgr_collector_list_actions="--begin --color --cron --debug --end --format -h --help"
nodemgr_collector_cli="--api --color --config --cron --debug --format --insecure --password --refresh-api --user -h --help"
nodemgr_collector_tag="--color --cron --debug --format --tag -h --help"
nodemgr_collector_list_services="--color --cron --debug --format -h --help"
nodemgr_collector_networks="--color --cron --debug --format -h --help"
nodemgr_collector_untag="--color --cron --debug --format -h --help"
nodemgr_collector_show_actions="--begin --color --cron --debug --end --format --id -h --help"
nodemgr_collector_checks="--color --cron --debug --format -h --help"
nodemgr_collector_show_tags="--color --cron --debug --format -h --help"
nodemgr_collector_create_tag="--color --cron --debug --format --tag -h --help"
nodemgr_collector_list_nodes="--color --cron --debug --format -h --help"
nodemgr_collector_ack_action="--author --color --comment --cron --debug --format -h --help"
nodemgr_collector_alerts="--color --cron --debug --format -h --help"
nodemgr_collector_asset="--color --cron --debug --format -h --help"
nodemgr_discover="--color --cron --debug --format -h --help"
nodemgr_print_authconfig="--color --cron --debug --format -h --help"
nodemgr_set="--color --cron --debug --format --param --value -h --help"
nodemgr_unset="--color --cron --debug --format --param -h --help"
nodemgr_get="--color --cron --debug --format --param -h --help"
nodemgr_edit_config="--color --cron --debug --format -h --help"
nodemgr_register="--app --color --cron --debug --format --password --user -h --help"
nodemgr_edit_authconfig="--color --cron --debug --format -h --help"
nodemgr_print_config="--color --cron --debug --format -h --help"
nodemgr_schedulers="--color --cron --debug --format -h --help"
nodemgr_logs="--color --cron --debug --format -h --help"
nodemgr_updatepkg="--color --cron --debug --format -h --help"
nodemgr_unschedule_reboot="--color --cron --debug --format -h --help"
nodemgr_rotate_root_pw="--color --cron --debug --format -h --help"
nodemgr_scheduler="--color --cron --debug --format -h --help"
nodemgr_reboot="--color --cron --debug --format -h --help"
nodemgr_updatecomp="--color --cron --debug --format -h --help"
nodemgr_schedule_reboot="--color --cron --debug --format -h --help"
nodemgr_collect_stats="--color --cron --debug --format -h --help"
nodemgr_shutdown="--color --cron --debug --format -h --help"
nodemgr_print_schedule="--color --cron --debug --format --verbose -h --help"
nodemgr_schedule_reboot_status="--color --cron --debug --format -h --help"
nodemgr_dequeue_actions="--color --cron --debug --format -h --help"
nodemgr_array="--color --cron --debug --format -h --help"
nodemgr_wol="--broadcast --color --cron --debug --format --mac -h --help"
nodemgr_scanscsi="--color --cron --debug --format --hba --lun --target -h --help"

opts_with_arg=( "--api" "--app" "--author" "--begin" "--broadcast" "--color" "--comment" "--config" "--duration" "--end" "--env" "--format" "--hba" "--id" "--like" "--lun" "--mac" "--message" "--module" "--moduleset" "--object" "--param" "--password" "--resource" "--rid" "--ruleset" "--ruleset-date" "--service" "--slave" "--stats-dir" "--status" "--subsets" "--symcli-db-file" "--tag" "--tags" "--target" "--template" "--to" "--user" "--value" "--waitlock" "-s" )



svcs=$(find /etc/opensvc /opt/opensvc/etc -maxdepth 1 -lname "*/bin/svcmgr" -a ! -name "*.*" -exec basename {} \; 2>/dev/null)

opt_has_arg()
{
    for option in ${opts_with_arg[@]}
    do
        if [ "$option" == "$1" ]
        then
            return 0
        fi
    done
    return 1
}

_comp_handler() 
{
    local a prev action opts
    COMPREPLY=()
    if [ "${COMP_WORDS[0]}" != "nodemgr" ]
    then
        COMP_WORDS[0]="svcmgr"
    fi
    a="${COMP_WORDS[COMP_CWORD]}"
    prev="${COMP_WORDS[COMP_CWORD-1]}"

    case "${prev}" in
        --color)
            COMPREPLY=( $(compgen -W "yes no" -- ${a}) )
            return 0
            ;;
        --format)
            COMPREPLY=( $(compgen -W "csv json table" -- ${a}) )
            return 0
            ;;
        --service|-s)
            COMPREPLY=( $(compgen -W "${svcs}" -- ${a}) )
            return 0
            ;;
        *)
        ;;
    esac

    action=()
    typeset -i skip=0

    for word in ${COMP_WORDS[@]}
    do
        if [ "${word#-}" != "${word}" ]
        then
            opt_has_arg ${word} && skip=1
        elif [ $skip -eq 1 ]
        then
            skip=0
        else
            action+=(${word})
        fi
    done

    action="${action[@]}"
    action="${action// /_}"
    opts=""

    while [ "$action" != "" -a "$opts" == "" ]
    do
        opts="${!action}"
        action=${action%_*}
    done

    extra_opts="${!action}"
    if [ "$a" != "" -a "$opts" != "" ]
    then
        opts="$opts $extra_opts"
    fi

    COMPREPLY=($(compgen -W "${opts}" -- ${a}))

    return 0
}

complete -F _comp_handler svcmgr

for s in ${svcs} ; do
    complete -F _comp_handler $s
done

complete -F _comp_handler nodemgr

