Compare commits

...

2 Commits
main ... 1.3.0

Author SHA1 Message Date
Florian Baumann
c444a621b1 Add option to only add unique cards 2022-11-28 12:02:28 +01:00
Florian Baumann
bb262495b1 demo 2022-11-03 10:40:16 +01:00
4 changed files with 59 additions and 0 deletions

BIN
demo.gif Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 30 KiB

51
demo.tape Normal file
View File

@ -0,0 +1,51 @@
# VHS documentation
#
# Output:
# Output <path>.gif Create a GIF output at the given <path>
# Output <path>.mp4 Create an MP4 output at the given <path>
# Output <path>.webm Create a WebM output at the given <path>
#
# Settings:
# Set FontSize <number> Set the font size of the terminal
# Set FontFamily <string> Set the font family of the terminal
# Set Height <number> Set the height of the terminal
# Set Width <number> Set the width of the terminal
# Set LetterSpacing <float> Set the font letter spacing (tracking)
# Set LineHeight <float> Set the font line height
# Set Theme <string> Set the theme of the terminal (JSON)
# Set Padding <number> Set the padding of the terminal
# Set Framerate <number> Set the framerate of the recording
# Set PlaybackSpeed <float> Set the playback speed of the recording
#
# Sleep:
# Sleep <time> Sleep for a set amount of <time> in seconds
#
# Type:
# Type[@<time>] "<characters>" Type <characters> into the terminal with a
# <time> delay between each character
#
# Keys:
# Backspace[@<time>] [number] Press the Backspace key
# Down[@<time>] [number] Press the Down key
# Enter[@<time>] [number] Press the Enter key
# Space[@<time>] [number] Press the Space key
# Tab[@<time>] [number] Press the Tab key
# Left[@<time>] [number] Press the Left Arrow key
# Right[@<time>] [number] Press the Right Arrow key
# Up[@<time>] [number] Press the Up Arrow key
# Down[@<time>] [number] Press the Down Arrow key
# Ctrl+<key> Press the Control key + <key> (e.g. Ctrl+C)
#
# Display:
# Hide Hide the subsequent commands from the output
# Show Show the subsequent commands in the output
Output demo.gif
Set FontSize 32
Set Width 1200
Set Height 600
Type "serra --version" Sleep 500ms Enter
Sleep 5s

View File

@ -9,6 +9,7 @@ import (
func init() {
addCmd.Flags().Int64VarP(&count, "count", "c", 1, "Amount of cards to add")
addCmd.Flags().BoolVarP(&unique, "unique", "u", false, "Only add card if not existent yet")
rootCmd.AddCommand(addCmd)
}
@ -39,6 +40,12 @@ var addCmd = &cobra.Command{
// If duplicate key, increase count of card
if mongo.IsDuplicateKeyError(err) {
if unique {
LogMessage(fmt.Sprintf("Not adding \"%s\" to Collection because it already exists.", c.Name), "red")
continue
}
modify_count_of_card(coll, c, count)
continue
}

View File

@ -13,6 +13,7 @@ var limit float64
var name string
var since string
var rarity, set, sort string
var unique bool
var rootCmd = &cobra.Command{
Version: Version,