Documentation
¶
Overview ¶
Package cmds used for commands modules
Package cmds used for commands modules ¶
Package cmds used for commands modules ¶
Package cmds used for commands modules ¶
Package cmds used for commands modules ¶
Package cmds used for commands modules ¶
Package cmds used for commands modules ¶
Package cmds used for commands modules ¶
Package cmds used for commands modules ¶
Package cmds used for commands modules ¶
Package cmds used for commands modules ¶
Package cmds used for commands modules
Index ¶
- Constants
- Variables
- func HelpFunc(_ *Command, args ...string) error
- func ModulesRuntime(args []string, config *cfg.Config, client *internal.Client, fs afero.Fs)
- type Command
- func (c *Command) BadArgs(errFormat string, args ...any)
- func (c *Command) Errorf(errFormat string, args ...any)
- func (c *Command) Exec(fs afero.Fs, client *internal.Client, config *cfg.Config, args []string) error
- func (c *Command) ExportListProcess(data *str.ExportlistItem, options *str.Options, findDuplicates []any, ...) ([]any, []str.ExportlistItemJSON, error)
- func (c *Command) Fatalf(errFormat string, args ...any)
- func (*Command) IsImdbEpisode(options *str.Options, data *str.ExportlistItem) bool
- func (*Command) IsImdbMovie(options *str.Options, data *str.ExportlistItem) bool
- func (*Command) IsImdbShow(options *str.Options, data *str.ExportlistItem) bool
- func (*Command) IsTmdbEpisode(options *str.Options, data *str.ExportlistItem) bool
- func (*Command) IsTmdbMovie(options *str.Options, data *str.ExportlistItem) bool
- func (*Command) IsTmdbShow(options *str.Options, data *str.ExportlistItem) bool
- func (*Command) IsTvdbEpisode(options *str.Options, data *str.ExportlistItem) bool
- func (*Command) PrepareQueryString(q string) *string
- func (c *Command) UpdateOptionsWithCommandFlags(options *str.Options) *str.Options
- func (*Command) ValidFlags() bool
- func (*Command) ValidType(options *str.Options) error
Constants ¶
const ( SearchActionUsage = "allow to overwrite action in search command" IDLookupUsage = "allow to overwrite id in search lookup" IDTypeUsage = "allow to overwrite id_type in search lookup" )
Usage strings in module
const ( FoundOne = 1 NotFound = 0 )
runtime consts
Variables ¶
var (
AppFs = afero.NewOsFs()
)
Command vars
var Avflags = map[string]bool{ "a": true, "c": true, "calendars": true, "checkin": true, "collection": true, "days": true, "delete": true, "ex": true, "f": true, "field": true, "godoc": true, "help": true, "history": true, "i": true, "trakt_id": true, "episode_code": true, "episode_abs": true, "id_type": true, "lists": true, "msg": true, "o": true, "people": true, "q": true, "remove": true, "search": true, "start_date": true, "t": true, "u": true, "users": true, "v": true, "version": true, "watchlist": true, }
Avflags contains all available flags
var CalendarsCmd = &Command{
Name: "calendars",
Usage: "",
Summary: "By default, the calendar will return all shows or movies for the specified time period and can be global or user specific.",
Help: `calendars command`,
}
CalendarsCmd process selected user calendars
var CheckinCmd = &Command{
Name: "checkin",
Usage: "",
Summary: "Checkin movie,episode,show_episode,delete",
Help: `checkin command`,
}
CheckinCmd create or delete active checkins.
var CollectionCmd = &Command{
Name: "collection",
Usage: "",
Summary: "Get all collected items in a user's collection.",
Help: `collection command`,
}
CollectionCmd get all collected items in a user's collection.
var Commands = []*Command{ CalendarsCmd, CheckinCmd, CollectionCmd, HelpCmd, HistoryCmd, ListsCmd, PeopleCmd, SearchCmd, UsersCmd, WatchlistCmd, }
Commands is list of all commands
var HelpCmd = &Command{
Name: "help",
Usage: "[<commands>]",
Summary: "Help on the trakt-sync command and subcommands.",
}
HelpCmd shows help on the trakt-sync command and subcommands.
var HistoryCmd = &Command{
Name: "history",
Usage: "",
Summary: "Returns movies and episodes that a user has watched, sorted by most recent.",
Help: `history command`,
}
HistoryCmd returns movies and episodes that a user has watched, sorted by most recent.
var ListsCmd = &Command{
Name: "lists",
Usage: "",
Summary: "Returns data about lists: trending, popular, list, likes, like, items, comments.",
Help: `lists command`,
}
ListsCmd returns movies and episodes that a user has watched, sorted by most recent.
var PeopleCmd = &Command{
Name: "people",
Usage: "",
Summary: "Returns all data for selected person.",
Help: `people command`,
}
PeopleCmd returns all data for selected person.
var SearchCmd = &Command{
Name: "search",
Usage: "",
Summary: "Searches can use queries or ID lookups",
Help: `search command: Queries will search text fields like the title and overview. ID lookups are helpful if you have an external ID and want to get the Trakt ID and info. These methods can search for movies, shows, episodes, people, and str.`,
}
SearchCmd can use queries or ID lookups
var UsersCmd = &Command{
Name: "users",
Usage: "",
Summary: "Returns all data for a users.",
Help: `users command`,
}
UsersCmd Returns all personal lists for a user.
var WatchlistCmd = &Command{
Name: "watchlist",
Usage: "",
Summary: "Returns all items in a user's watchlist filtered by type.",
Help: `watchlist command`,
}
WatchlistCmd Returns all items in a user's watchlist filtered by type.
Functions ¶
Types ¶
type Command ¶
type Command struct {
Flag flag.FlagSet
Run func(cmd *Command, args ...string) error
Client *internal.Client
Config *cfg.Config
Options *str.Options
Name string
Usage string
Summary string
Help string
Abbrev string
// contains filtered or unexported fields
}
A Command represents a subcommand of trakt-sync.
func (*Command) Exec ¶
func (c *Command) Exec(fs afero.Fs, client *internal.Client, config *cfg.Config, args []string) error
Exec core command function
func (*Command) ExportListProcess ¶
func (c *Command) ExportListProcess( data *str.ExportlistItem, options *str.Options, findDuplicates []any, exportJSON []str.ExportlistItemJSON, ) ([]any, []str.ExportlistItemJSON, error)
ExportListProcess process list items
func (*Command) Fatalf ¶
Fatalf is like Errorf except the stack unwinds up to the Exec call before exiting the application with status code 1.
func (*Command) IsImdbEpisode ¶ added in v1.0.2
IsImdbEpisode check episode imdb format
func (*Command) IsImdbMovie ¶ added in v1.0.2
IsImdbMovie check movie imdb format
func (*Command) IsImdbShow ¶ added in v1.0.2
IsImdbShow check show imdb format
func (*Command) IsTmdbEpisode ¶ added in v1.0.2
IsTmdbEpisode check episode tmdb format
func (*Command) IsTmdbMovie ¶ added in v1.0.2
IsTmdbMovie check movie tmdb format
func (*Command) IsTmdbShow ¶ added in v1.0.2
IsTmdbShow check show tmdb format
func (*Command) IsTvdbEpisode ¶ added in v1.0.2
IsTvdbEpisode check episode tvdb format
func (*Command) PrepareQueryString ¶
PrepareQueryString for remove or replace unwanted signs from query string
func (*Command) UpdateOptionsWithCommandFlags ¶
UpdateOptionsWithCommandFlags update options depends on command flags
func (*Command) ValidFlags ¶
ValidFlags validate if flag is in our list