From 1939949fcdd5d540fd20ead79b9c5d27e85e8f9d Mon Sep 17 00:00:00 2001 From: Sascha Date: Sun, 9 May 2021 11:14:45 +0200 Subject: CLI: Add non-interactive option to interactive commands (#651) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * Add option to skip the AvatarURL input request Using an empty string for the avatar cli flag e.g. `git-bug user create -a ""` will still result in a prompt. As the avatar URL is an optional option, it should be possible to skip asking for it entirely. Otherwise automated user creation via a script must make use of pipe hacks. * Add global --non-interactive cmdline option * Replace --skipAvatar for --non-interactive option * Cmd BugAdd: respect non-interactive option * Cmd bridge configure: respect non-interactive opt * Cmd CommentAdd: respect non-interactive option * Cmd CommentEdit: respect non-interactive option * Cmd TermUI: respect non-interactive option * Cmd TitleEdit: respect non-interactive option * Remove global non-interactive option * Cmd UserCreate: Use local non-interactive option * Cmd BugAdd: Use local non-interactive option * Cmd BridgeConfigure: Use local non-interactive option * Cmd CommentAdd: Use local non-interactive option * Cmd CommentEdit: Use local non-interactive option * Cmd TermUI: Drop non-interactive option It should be obviouse that the termui is an interactive command. * Cmd TitleEdit: Use local non-interactive option * Update docs * Bridge GitHub: respect non-interactive option * Bridge GitLab: respect non-interactive option * Bridge Jira: respect non-interactive and token opt * Fix failing compilation * Bridge launchpad: respect non-interactive option * bridge: isNonInteractive --> interactive Co-authored-by: Michael Muré --- misc/bash_completion/git-bug | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'misc') diff --git a/misc/bash_completion/git-bug b/misc/bash_completion/git-bug index bdca026f..8b303991 100644 --- a/misc/bash_completion/git-bug +++ b/misc/bash_completion/git-bug @@ -390,6 +390,8 @@ _git-bug_add() local_nonpersistent_flags+=("--file") local_nonpersistent_flags+=("--file=") local_nonpersistent_flags+=("-F") + flags+=("--non-interactive") + local_nonpersistent_flags+=("--non-interactive") must_have_one_flag=() must_have_one_noun=() @@ -565,6 +567,8 @@ _git-bug_bridge_configure() local_nonpersistent_flags+=("--project") local_nonpersistent_flags+=("--project=") local_nonpersistent_flags+=("-p") + flags+=("--non-interactive") + local_nonpersistent_flags+=("--non-interactive") must_have_one_flag=() must_have_one_noun=() @@ -716,6 +720,8 @@ _git-bug_comment_add() local_nonpersistent_flags+=("--message") local_nonpersistent_flags+=("--message=") local_nonpersistent_flags+=("-m") + flags+=("--non-interactive") + local_nonpersistent_flags+=("--non-interactive") must_have_one_flag=() must_have_one_noun=() @@ -748,6 +754,8 @@ _git-bug_comment_edit() local_nonpersistent_flags+=("--message") local_nonpersistent_flags+=("--message=") local_nonpersistent_flags+=("-m") + flags+=("--non-interactive") + local_nonpersistent_flags+=("--non-interactive") must_have_one_flag=() must_have_one_noun=() @@ -1196,6 +1204,8 @@ _git-bug_title_edit() local_nonpersistent_flags+=("--title") local_nonpersistent_flags+=("--title=") local_nonpersistent_flags+=("-t") + flags+=("--non-interactive") + local_nonpersistent_flags+=("--non-interactive") must_have_one_flag=() must_have_one_noun=() @@ -1275,6 +1285,8 @@ _git-bug_user_create() local_nonpersistent_flags+=("--name") local_nonpersistent_flags+=("--name=") local_nonpersistent_flags+=("-n") + flags+=("--non-interactive") + local_nonpersistent_flags+=("--non-interactive") must_have_one_flag=() must_have_one_noun=() -- cgit