Skip to content

Commit

Permalink
Improve docs
Browse files Browse the repository at this point in the history
  • Loading branch information
deanishe committed Feb 15, 2019
1 parent 0b7b209 commit 0cf061c
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 15 deletions.
19 changes: 9 additions & 10 deletions feedback.go
Original file line number Diff line number Diff line change
Expand Up @@ -326,11 +326,10 @@ func (m *Modifier) MarshalJSON() ([]byte, error) {

// Feedback represents the results for an Alfred Script Filter.
//
// Normally, you won't use this struct directly, but via the
// package-level functions/Workflow methods NewItem(), SendFeedback(), etc.
// It is important to use the constructor functions for Feedback, Item
// and Modifier structs so they are properly initialised and bound to
// their parent.
// Normally, you won't use this struct directly, but via the Workflow methods
// NewItem(), SendFeedback(), etc. It is important to use the constructor
// functions for Feedback, Item and Modifier structs so they are properly
// initialised and bound to their parent.
type Feedback struct {
Items []*Item // The results to be sent to Alfred.
NoUIDs bool // If true, suppress Item UIDs.
Expand Down Expand Up @@ -396,11 +395,11 @@ func (fb *Feedback) NewItem(title string) *Item {
}

// NewFileItem adds and returns a pointer to a new item pre-populated from path.
// Title and Autocomplete are the base name of the file;
// Subtitle is the path to the file (using "~" for $HOME);
// Valid is true;
// UID and Arg are set to path;
// Type is "file"; and
// Title and Autocomplete are the base name of the file,
// Subtitle is the path to the file (using "~" for $HOME),
// Valid is true,
// UID and Arg are set to path,
// Type is "file", and
// Icon is the icon of the file at path.
func (fb *Feedback) NewFileItem(path string) *Item {
t := filepath.Base(path)
Expand Down
2 changes: 1 addition & 1 deletion icons.go
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ var (
// Type = IconTypeFileIcon will treat Value as the path to a file or
// directory and use that file's icon, e.g:
//
// icon := &Icon{"/Applications/Mail.app", IconTypeFileIcon}
// icon := &aw.Icon{"/Applications/Mail.app", aw.IconTypeFileIcon}
//
// will display Mail.app's icon.
//
Expand Down
7 changes: 3 additions & 4 deletions workflow.go
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,8 @@ type Workflow struct {
Updater Updater

// MagicActions contains the magic actions registered for this workflow.
// It is set to DefaultMagicActions by default.
// Several built-in actions are registered by default. See the docs for
// MagicAction for details.
MagicActions *MagicActions

logPrefix string // Written to debugger to force a newline
Expand Down Expand Up @@ -198,9 +199,7 @@ func (wf *Workflow) initializeLogging() {
}

// Open log file
file, err := os.OpenFile(wf.LogFile(),
os.O_CREATE|os.O_WRONLY|os.O_APPEND, 0600)

file, err := os.OpenFile(wf.LogFile(), os.O_CREATE|os.O_WRONLY|os.O_APPEND, 0600)
if err != nil {
wf.Fatal(fmt.Sprintf("Couldn't open log file %s : %v",
wf.LogFile(), err))
Expand Down

0 comments on commit 0cf061c

Please sign in to comment.