Skip to content
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 [history] spec #2040

Open
wants to merge 4 commits into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
29 changes: 29 additions & 0 deletions src/history.ts
@@ -0,0 +1,29 @@
const completionSpec: Fig.Spec = {
name: "history",
description: "Shows last 15 commands",
subcommands: [
{
name: "0",
description: "Shows full command history",
},
{
name: "|",
description: "Divider to run other commands on history",
subcommands: [
{
name: "grep",
description: "Search history",
},
],
},
],
Comment on lines +4 to +19
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These should not be subcommands. 0 is an argument. (You can pass a number of history items you wish to show.)

The pipe and "grep" should be removed entirely since these are not syntax of the history command, but other shell constructs and commands.

options: [
{
name: ["--clear", "-c"],
description: "Clears history",
},
],
// Only uncomment if history takes an argument
// args: {}
};
export default completionSpec;