gitmopy.prompt¶
Module handling user prompts.
Prompts typically parameterize the commit message or gitmopy’s behavior.
Module Contents¶
- class gitmopy.prompt.GMPCompleter(key, max_results=10)[source]¶
A completer that completes a text prompt from the user’s history.
Completions are sorted by most recent first. Returns up to
self.max_resultsresults.- Parameters:
- get_completions(document, complete_event)[source]¶
Get completions for the current prompt.
A completion is a string from the user’s history that starts with all the characters in the current prompt.
Case insensitive.
- Parameters:
document (prompt_toolkit.document.Document) – The current document from the prompt.
complete_event (Any) – Unused.
- Yields:
Completion – A completion object that replaces the current user’s input.
- Return type:
prompt_toolkit.completion.Completion
- gitmopy.prompt.commit_prompt(config, state=None, simple=False)[source]¶
Prompt the user for emoji, scope title and message to make a commit message.
Scope and message are optional. Scope and message can be bypassed from the config (run
gitmopy config) Scope, title and message are completed from the user’s history ifconfig["enable_history"]isTrue.
- gitmopy.prompt.config_prompt()[source]¶
Prompt the user for configuration options.
Will setup: - Whether to skip scope - Whether to skip message - Whether to capitalize title - Whether to enable history
Will save the configuration in
${APP_PATH}/config.yaml.- Return type:
None
- gitmopy.prompt.confirm_prompt(message, default=False)[source]¶
Prompt the user to confirm an action.
- gitmopy.prompt.git_add_prompt(status)[source]¶
Start a prompt to select files to add to the commit.
Files are grouped by status (unstaged, untracked).
Files are all selected by default.
- gitmopy.prompt.set_upstream_prompt(branch_name, remote_name)[source]¶
Prompt the user to set the upstream branch for a remote.