Documentation
¶
Index ¶
- Variables
- func AppName() string
- func ArgDebug() bool
- func ArgLogger() bool
- func Debugger()
- func DryRun() bool
- func ExitWatchdog()
- func GetLast(cur string, argv []string) string
- func MakeAutocompleteFiles(argname string)
- func MakeBashCompleteFiles(argname string)
- func MakeZshCompleteFiles(argname string)
- func StandardVersion(ARGNAME, VERSION, BUILDTIME string) string
- type ArgsBash
- type ArgsDebugger
- type Auto
- func (pb *Auto) Autocomplete2(sendthis string)
- func (pb *Auto) Autocomplete3(sendthis []string)
- func (pb *Auto) BadExit(msg string, err error)
- func (pb *Auto) Debugf(fmts string, parts ...any)
- func (*Auto) Descriptor() ([]byte, []int)deprecated
- func (v *Auto) FormatJSON() string
- func (v *Auto) FormatTEXT() string
- func (pb *Auto) GenerateSubCommandStrings(cmd ...string)
- func (x *Auto) GetArg0() string
- func (x *Auto) GetArg1() string
- func (x *Auto) GetArg3() string
- func (x *Auto) GetArgname() string
- func (x *Auto) GetArgv() []string
- func (x *Auto) GetCmd() string
- func (x *Auto) GetCtime() *timestamppb.Timestamp
- func (x *Auto) GetDebug() bool
- func (x *Auto) GetDuration() *durationpb.Duration
- func (x *Auto) GetFast() bool
- func (x *Auto) GetFastcmd() string
- func (x *Auto) GetGoargs() []string
- func (x *Auto) GetIsAuto() bool
- func (x *Auto) GetLast() string
- func (x *Auto) GetNewline() bool
- func (x *Auto) GetPartial() string
- func (x *Auto) GetSetupAuto() bool
- func (pb *Auto) GoodExit(msg string)
- func (v *Auto) Marshal() ([]byte, error)
- func (v *Auto) MarshalJSON() ([]byte, error)
- func (pb *Auto) PrintDebug()
- func (pb *Auto) PrintDebugNew(msg string)
- func (*Auto) ProtoMessage()
- func (x *Auto) ProtoReflect() protoreflect.Message
- func (x *Auto) Reset()
- func (pb *Auto) SendString(sendthis string)
- func (pb *Auto) SendStrings(parts []string)
- func (x *Auto) String() string
- func (pb *Auto) SubCommand(cmd ...string)
- func (v *Auto) Unmarshal(data []byte) error
- func (v *Auto) UnmarshalJSON(data []byte) error
- func (v *Auto) UnmarshalTEXT(data []byte) error
- func (pb *Auto) Version() string
- func (pb *Auto) WriteHelp()
- type AutoArgs
- type AutoScanner
- type Autos
- func (x *Autos) All() *AutoScanner
- func (x *Autos) Append(y *Auto)
- func (x *Autos) Clone(y *Auto) *Auto
- func (x *Autos) Delete(y *Auto) bool
- func (*Autos) Descriptor() ([]byte, []int)deprecated
- func (v *Autos) FormatJSON() string
- func (v *Autos) FormatTEXT() string
- func (x *Autos) GetAutos() []*Auto
- func (x *Autos) GetFilename() string
- func (x *Autos) GetUuid() string
- func (x *Autos) GetVersion() string
- func (x *Autos) IterAll() iter.Seq[*Auto]
- func (x *Autos) Len() int
- func (pb *Autos) Load() error
- func (v *Autos) Marshal() ([]byte, error)
- func (v *Autos) MarshalJSON() ([]byte, error)
- func (all *Autos) PrintHistory()
- func (*Autos) ProtoMessage()
- func (x *Autos) ProtoReflect() protoreflect.Message
- func (x *Autos) Reset()
- func (pb *Autos) Save() error
- func (x *Autos) String() string
- func (v *Autos) Unmarshal(data []byte) error
- func (v *Autos) UnmarshalJSON(data []byte) error
- func (v *Autos) UnmarshalTEXT(data []byte) error
- type AutosScanner
- type ExitCode
- type GuiPrep
Constants ¶
This section is empty.
Variables ¶
var CHAN *log.LogFlag
var File_auto_proto protoreflect.FileDescriptor
var INFO *log.LogFlag
var POLL *log.LogFlag
var WARN *log.LogFlag
Functions ¶
func AppName ¶ added in v0.0.6
func AppName() string
returns the name of the executable registered for shell autocomplete
func ExitWatchdog ¶ added in v0.0.32
func ExitWatchdog()
this code doesn't need to be this complicated. I put it here as reference code for myself so I could remember where it is.
func MakeAutocompleteFiles ¶ added in v0.0.33
func MakeAutocompleteFiles(argname string)
func MakeBashCompleteFiles ¶ added in v0.0.33
func MakeBashCompleteFiles(argname string)
func MakeZshCompleteFiles ¶ added in v0.0.33
func MakeZshCompleteFiles(argname string)
func StandardVersion ¶ added in v0.0.24
Types ¶
type ArgsBash ¶ added in v0.0.3
type ArgsBash struct {
Bash bool `arg:"--bash" help:"generate bash completion"`
}
type ArgsDebugger ¶
type ArgsDebugger struct {
Debugger bool `arg:"--debugger" help:"open the debugger window"`
Logger bool `arg:"--logger" help:"open the log.* control window"`
}
This struct can be used with the go-arg package
type Auto ¶ added in v0.0.8
type Auto struct {
Ctime *timestamppb.Timestamp `protobuf:"bytes,1,opt,name=ctime,proto3" json:"ctime,omitempty"` // when the user tried this autocomplete
Duration *durationpb.Duration `protobuf:"bytes,2,opt,name=duration,proto3" json:"duration,omitempty"` // time since the last autocomplete
Argname string `protobuf:"bytes,3,opt,name=argname,proto3" json:"argname,omitempty"` // what the shell thinks the name of the executable is
Arg0 string `protobuf:"bytes,4,opt,name=arg0,proto3" json:"arg0,omitempty"` // what os.Exec() has as os.Argv[0] // not interesting
Arg1 string `protobuf:"bytes,5,opt,name=arg1,proto3" json:"arg1,omitempty"` // should always be "--auto-complete" // not interesting
Arg3 string `protobuf:"bytes,6,opt,name=arg3,proto3" json:"arg3,omitempty"` // usually argv3 == argv0
Argv []string `protobuf:"bytes,7,rep,name=argv,proto3" json:"argv,omitempty"` // use this to store whatever you want while the whole POST happens
Cmd string `protobuf:"bytes,8,opt,name=cmd,proto3" json:"cmd,omitempty"` // the cmd being processed. For "git pull <tab>", cmd would be "pull"
Partial string `protobuf:"bytes,9,opt,name=partial,proto3" json:"partial,omitempty"` // set to the partial string trying to be matched
IsAuto bool `protobuf:"varint,10,opt,name=isAuto,proto3" json:"isAuto,omitempty"` // is true if '--auto-complete' is set
SetupAuto bool `protobuf:"varint,11,opt,name=setupAuto,proto3" json:"setupAuto,omitempty"` // is true if '--bash' is set // setup bash autocomplete here
Debug bool `protobuf:"varint,12,opt,name=debug,proto3" json:"debug,omitempty"` // print debugging info if true
Newline bool `protobuf:"varint,13,opt,name=newline,proto3" json:"newline,omitempty"` // was a newline was sent to STDERR?
Last string `protobuf:"bytes,14,opt,name=last,proto3" json:"last,omitempty"` // the last arg
Goargs []string `protobuf:"bytes,15,rep,name=goargs,proto3" json:"goargs,omitempty"` // what to send to alex flint's go-args for help
Fast bool `protobuf:"varint,16,opt,name=fast,proto3" json:"fast,omitempty"` // was the user fast last time?
Fastcmd string `protobuf:"bytes,17,opt,name=fastcmd,proto3" json:"fastcmd,omitempty"` // what subcommand was the user fast on?
// contains filtered or unexported fields
}
func Autocomplete ¶ added in v0.0.32
func (*Auto) Autocomplete2 ¶ added in v0.0.8
deprecate
func (*Auto) Autocomplete3 ¶ added in v0.0.12
deprecate
func (*Auto) Descriptor
deprecated
added in
v0.0.8
func (*Auto) FormatTEXT ¶ added in v0.0.8
apparently this isn't stable, but it's awesomely better https://protobuf.dev/reference/go/faq/#unstable-text it's brilliant for config files!
func (*Auto) GenerateSubCommandStrings ¶ added in v0.0.32
try out a new name. also, this whole thing is dumb and needs to be redone
func (*Auto) GetArgname ¶ added in v0.0.8
func (*Auto) GetCtime ¶ added in v0.0.8
func (x *Auto) GetCtime() *timestamppb.Timestamp
func (*Auto) GetDuration ¶ added in v0.0.8
func (x *Auto) GetDuration() *durationpb.Duration
func (*Auto) GetFastcmd ¶ added in v0.0.32
func (*Auto) GetNewline ¶ added in v0.0.8
func (*Auto) GetPartial ¶ added in v0.0.8
func (*Auto) GetSetupAuto ¶ added in v0.0.8
func (*Auto) MarshalJSON ¶ added in v0.0.8
marshal json
func (*Auto) PrintDebug ¶ added in v0.0.8
func (pb *Auto) PrintDebug()
print out auto complete debugging info
func (*Auto) PrintDebugNew ¶ added in v0.0.33
func (*Auto) ProtoMessage ¶ added in v0.0.8
func (*Auto) ProtoMessage()
func (*Auto) ProtoReflect ¶ added in v0.0.8
func (x *Auto) ProtoReflect() protoreflect.Message
func (*Auto) SendString ¶ added in v0.0.32
the application must send a string "help run list"
func (*Auto) SendStrings ¶ added in v0.0.32
the application must send an array []string{"help", "run", "list"}
func (*Auto) SubCommand ¶ added in v0.0.12
func (*Auto) UnmarshalJSON ¶ added in v0.0.8
unmarshal json
func (*Auto) UnmarshalTEXT ¶ added in v0.0.8
unmarshalTEXT. This reads the .text config file back in after the user edits it
type AutoArgs ¶ added in v0.0.8
type AutoArgs struct {
// hidden bool // don't update the toolkits when it's hidden
Auto func([]string) // the function for shell autocomplete
ARGNAME string // a good way to track the name of the binary ?
VERSION string
BUILDTIME string
// contains filtered or unexported fields
}
this is a work in progress
type AutoScanner ¶ added in v0.0.8
func (*AutoScanner) Next ¶ added in v0.0.8
func (it *AutoScanner) Next() *Auto
Next() returns the next thing in the array
func (*AutoScanner) Scan ¶ added in v0.0.8
func (it *AutoScanner) Scan() bool
type Autos ¶ added in v0.0.8
type Autos struct {
Uuid string `protobuf:"bytes,1,opt,name=uuid,proto3" json:"uuid,omitempty"` // `autogenpb:uuid:94210ebf-a534-4b33-aadd-2f5e1f56ae38`
Version string `protobuf:"bytes,2,opt,name=version,proto3" json:"version,omitempty"` // `autogenpb:version:v0.0.1`
Autos []*Auto `protobuf:"bytes,3,rep,name=autos,proto3" json:"autos,omitempty"`
Filename string `protobuf:"bytes,4,opt,name=filename,proto3" json:"filename,omitempty"` // `autogenpb:save` -- this enables autogenerated pb.Load() and pb.Save()
// contains filtered or unexported fields
}
func (*Autos) All ¶ added in v0.0.8
func (x *Autos) All() *AutoScanner
func (*Autos) Append ¶ added in v0.0.8
a Append() shortcut (that does Clone() with a mutex) notsure if it really works
func (*Autos) Clone ¶ added in v0.0.30
a Clone() shortcut (with a mutex). notsure if it really works
func (*Autos) Descriptor
deprecated
added in
v0.0.8
func (*Autos) FormatTEXT ¶ added in v0.0.8
apparently this isn't stable, but it's awesomely better https://protobuf.dev/reference/go/faq/#unstable-text it's brilliant for config files!
func (*Autos) GetFilename ¶ added in v0.0.23
func (*Autos) GetVersion ¶ added in v0.0.8
func (*Autos) IterAll ¶ added in v0.0.8
Iterate 'for x := range' syntax using the awesome golang 1.24 'iter'
func (*Autos) MarshalJSON ¶ added in v0.0.8
marshal json
func (*Autos) PrintHistory ¶ added in v0.0.33
func (all *Autos) PrintHistory()
func (*Autos) ProtoMessage ¶ added in v0.0.8
func (*Autos) ProtoMessage()
func (*Autos) ProtoReflect ¶ added in v0.0.8
func (x *Autos) ProtoReflect() protoreflect.Message
func (*Autos) UnmarshalJSON ¶ added in v0.0.8
unmarshal json
func (*Autos) UnmarshalTEXT ¶ added in v0.0.8
unmarshalTEXT. This reads the .text config file back in after the user edits it
type AutosScanner ¶ added in v0.0.8
func (*AutosScanner) Next ¶ added in v0.0.8
func (it *AutosScanner) Next() *Autos
Next() returns the next thing in the array
func (*AutosScanner) Scan ¶ added in v0.0.8
func (it *AutosScanner) Scan() bool
type ExitCode ¶ added in v0.0.38
type ExitCode int
ExitCode represents a program's exit status code.
const ( // ExitSuccess indicates that the program completed its task without errors. ExitSuccess ExitCode = 0 // ExitFailure is a generic, catch-all code for "something went wrong." // It should be used if no other more specific code applies. ExitFailure ExitCode = 1 // ExitUsage indicates that the user provided invalid command-line arguments or flags. // (Standard: EX_USAGE) ExitUsage ExitCode = 64 // ExitDataErr indicates that the input data was incorrect or malformed. // (e.g., a corrupt configuration file). // (Standard: EX_DATAERR) ExitDataErr ExitCode = 65 // ExitNoInput indicates that an input file was not found or could not be read. // (Standard: EX_NOINPUT) ExitNoInput ExitCode = 66 // ExitNoUser indicates that a specified user did not exist. // (Standard: EX_NOUSER) ExitNoUser ExitCode = 67 // ExitNoHost indicates that a specified host did not exist. // (Standard: EX_NOHOST) ExitNoHost ExitCode = 68 // (Standard: EX_UNAVAILABLE) ExitUnavailable ExitCode = 69 // ExitSoftware indicates an internal software error. This is for unexpected // conditions and bugs ("this should never happen"). // (Standard: EX_SOFTWARE) ExitSoftware ExitCode = 70 // ExitOSErr indicates an operating system error, such as a failed system call. // (e.g., fork failed, couldn't create a directory). // (Standard: EX_OSERR) ExitOSErr ExitCode = 71 // ExitOSFile indicates a critical OS file is missing or corrupt. // (e.g., /etc/passwd). // (Standard: EX_OSFILE) ExitOSFile ExitCode = 72 // ExitCantCreat indicates that a user-specified output file could not be created. // (Standard: EX_CANTCREAT) ExitCantCreat ExitCode = 73 // ExitIOErr indicates an error occurred during an I/O operation. // (Standard: EX_IOERR) ExitIOErr ExitCode = 74 // ExitTempFail indicates a temporary failure. The user is invited to retry. // (Standard: EX_TEMPFAIL) ExitTempFail ExitCode = 75 // ExitProtocol indicates a protocol error during network communication. // (Standard: EX_PROTOCOL) ExitProtocol ExitCode = 76 // ExitNoPerm indicates that the user does not have sufficient permissions. // This is for filesystem permissions, not for authentication issues. // (Standard: EX_NOPERM) ExitNoPerm ExitCode = 77 // ExitConfig indicates that something is wrong in a configuration file. // (Standard: EX_CONFIG) ExitConfig ExitCode = 78 )