-
-
Notifications
You must be signed in to change notification settings - Fork 49
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
8 changed files
with
160 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
package cmd | ||
|
||
import ( | ||
"github.com/rsteube/carapace" | ||
"github.com/spf13/cobra" | ||
) | ||
|
||
var authCmd = &cobra.Command{ | ||
Use: "auth", | ||
Short: "Manage recordings on asciinema.org account", | ||
Run: func(cmd *cobra.Command, args []string) {}, | ||
} | ||
|
||
func init() { | ||
carapace.Gen(authCmd).Standalone() | ||
|
||
authCmd.Flags().BoolP("help", "h", false, "show this help message and exit") | ||
rootCmd.AddCommand(authCmd) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
package cmd | ||
|
||
import ( | ||
"github.com/rsteube/carapace" | ||
"github.com/spf13/cobra" | ||
) | ||
|
||
var catCmd = &cobra.Command{ | ||
Use: "cat", | ||
Short: "Print full output of recorded session", | ||
Run: func(cmd *cobra.Command, args []string) {}, | ||
} | ||
|
||
func init() { | ||
carapace.Gen(catCmd).Standalone() | ||
|
||
catCmd.Flags().BoolP("help", "h", false, "show this help message and exit") | ||
rootCmd.AddCommand(catCmd) | ||
|
||
carapace.Gen(catCmd).PositionalCompletion( | ||
carapace.ActionFiles(""), | ||
) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
package cmd | ||
|
||
import ( | ||
"github.com/rsteube/carapace" | ||
"github.com/spf13/cobra" | ||
) | ||
|
||
var playCmd = &cobra.Command{ | ||
Use: "play", | ||
Short: "Replay terminal recording", | ||
Run: func(cmd *cobra.Command, args []string) {}, | ||
} | ||
|
||
func init() { | ||
carapace.Gen(playCmd).Standalone() | ||
|
||
playCmd.Flags().BoolP("help", "h", false, "show this help message and exit") | ||
playCmd.Flags().StringP("idle-time-limit", "i", "", "limit idle time during playback to given number of seconds") | ||
playCmd.Flags().StringP("speed", "s", "", "playback speedup (can be fractional)") | ||
rootCmd.AddCommand(playCmd) | ||
|
||
carapace.Gen(playCmd).PositionalCompletion( | ||
carapace.ActionFiles(""), | ||
) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
package cmd | ||
|
||
import ( | ||
"github.com/rsteube/carapace" | ||
"github.com/spf13/cobra" | ||
) | ||
|
||
var recCmd = &cobra.Command{ | ||
Use: "rec", | ||
Short: "Record terminal session", | ||
Run: func(cmd *cobra.Command, args []string) {}, | ||
} | ||
|
||
func init() { | ||
carapace.Gen(recCmd).Standalone() | ||
|
||
recCmd.Flags().Bool("append", false, "append to existing recording") | ||
recCmd.Flags().StringP("command", "c", "", "command to record, defaults to $SHELL") | ||
recCmd.Flags().StringP("env", "e", "", "list of environment variables to capture") | ||
recCmd.Flags().BoolP("help", "h", false, "show this help message and exit") | ||
recCmd.Flags().StringP("idle-time-limit", "i", "", "limit recorded idle time to given number of seconds") | ||
recCmd.Flags().Bool("overwrite", false, "overwrite the file if it already exists") | ||
recCmd.Flags().BoolP("quiet", "q", false, "be quiet, suppress all notices/warnings (implies -y)") | ||
recCmd.Flags().Bool("raw", false, "save only raw stdout output") | ||
recCmd.Flags().Bool("stdin", false, "enable stdin recording, disabled by default") | ||
recCmd.Flags().StringP("title", "t", "", "title of the asciicast") | ||
recCmd.Flags().BoolP("yes", "y", false, "answer \"yes\" to all prompts (e.g. upload confirmation)") | ||
rootCmd.AddCommand(recCmd) | ||
|
||
carapace.Gen(recCmd).FlagCompletion(carapace.ActionMap{ | ||
"command": carapace.ActionFiles(""), // TODO PATH binaries | ||
}) | ||
|
||
carapace.Gen(recCmd).PositionalCompletion( | ||
carapace.ActionFiles(""), | ||
) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
package cmd | ||
|
||
import ( | ||
"github.com/rsteube/carapace" | ||
"github.com/spf13/cobra" | ||
) | ||
|
||
var rootCmd = &cobra.Command{ | ||
Use: "asciinema", | ||
Short: "Record and share your terminal sessions, the right way.", | ||
Run: func(cmd *cobra.Command, args []string) {}, | ||
} | ||
|
||
func Execute() error { | ||
return rootCmd.Execute() | ||
} | ||
func init() { | ||
carapace.Gen(rootCmd).Standalone() | ||
|
||
rootCmd.Flags().BoolP("help", "h", false, "show this help message and exit") | ||
rootCmd.Flags().Bool("version", false, "show program's version number and exit") | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
package cmd | ||
|
||
import ( | ||
"github.com/rsteube/carapace" | ||
"github.com/spf13/cobra" | ||
) | ||
|
||
var uploadCmd = &cobra.Command{ | ||
Use: "upload", | ||
Short: "Upload locally saved terminal session to asciinema.org", | ||
Run: func(cmd *cobra.Command, args []string) {}, | ||
} | ||
|
||
func init() { | ||
carapace.Gen(uploadCmd).Standalone() | ||
|
||
uploadCmd.Flags().BoolP("help", "h", false, "show this help message and exit") | ||
rootCmd.AddCommand(uploadCmd) | ||
|
||
carapace.Gen(uploadCmd).PositionalCompletion( | ||
carapace.ActionFiles(""), | ||
) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
package main | ||
|
||
import "github.com/rsteube/carapace-bin/completers/asciinema_completer/cmd" | ||
|
||
func main() { | ||
cmd.Execute() | ||
} |