def command_setup(self, *args):
def usage():<EOL><INDENT>print(self.command_setup.__doc__)<EOL>sys.exit(<NUM_LIT:1>)<EOL><DEDENT>if len(args) == <NUM_LIT:0>:<EOL><INDENT>usage()<EOL><DEDENT>try:<EOL><INDENT>fields = [<EOL>"<STR_LIT:id>", "<STR_LIT:host>", "<STR_LIT:port>", "<STR_LIT:user>",<EOL>"<STR_LIT>", "<STR_LIT>",<EOL>"<STR_LIT>", "<STR_LIT>",<EOL>"<STR_LIT>",<EOL>]<EOL>opts, _ = getopt.getopt(args, "<STR_LIT>", ["<STR_LIT>" % s for s in fields])<EOL><DEDENT>except getopt.GetoptError as e:<EOL><INDENT>sys.stderr.write('<STR_LIT>' % e)<EOL>usage()<EOL><DEDENT>system = SystemModel()<EOL>mount_opts = []<EOL>for name, value in opts:<EOL><INDENT>name = name.lstrip('<STR_LIT:->')<EOL>if not hasattr(system, name):<EOL><INDENT>continue<EOL><DEDENT>if name == '<STR_LIT>':<EOL><INDENT>mount_opts.append(value)<EOL>continue<EOL><DEDENT>setattr(system, name, value)<EOL><DEDENT>system.mount_opts = mount_opts<EOL>is_valid, errors = system.validate()<EOL>if not is_valid:<EOL><INDENT>sys.stderr.write('<STR_LIT>')<EOL>for field_name, msg in errors:<EOL><INDENT>sys.stderr.write('<STR_LIT>' % (field_name, msg))<EOL><DEDENT>sys.stderr.write('<STR_LIT:\n>')<EOL>usage()<EOL>sys.exit(<NUM_LIT:1>)<EOL><DEDENT>system.save(self.environment)<EOL>print('<STR_LIT>')<EOL>print('<STR_LIT>' % system.id)<EOL>
Defines a new sftp file system configuration or edits an old one with the same id.
        Usage: sftpman setup {options}
        Available {options}:
            --id={unique system identifier}
                You use this to recognize and manage this sftp system.
                It determines what the local mount point is.
                If `--id=example`, the filesystem will be mounted to: `/mnt/sshfs/example`
            --host={host to connect to}
            --port={port to connect to} [default: 22]
            --user={username to authenticate with}
            --mount_opt={option to pass to sshfs} [optional] [can be passed more than once]
                Example: --mount_opt="follow_symlinks" --mount_opt="workaround=rename"
                `sshfs --help` tells you what sshfs options are available
            --mount_point={remote path to mount}
            --auth_method={method}
                Specifies the authentication method.
                Can be `password`, `publickey`, `hostbased`, `keyboard-interactive` or `gssapi-with-mic`. [default: publickey]
            --ssh_key={path to the ssh key to use for authentication}
                Only applies if auth_method is `publickey`.
            --cmd_before_mount={command to run before mounting} [default: /bin/true]
                Allows you to run a custom command every time this system is mounted.