Commit 7312ff8
Changed files (4)
corpus/permissions.csv
@@ -510,3 +510,4 @@ linux permissions: what is the numeric mode of -rwxrwxr--,774,linux_acl
linux permissions: what is the numeric mode of -rwxrwxr-x,775,linux_acl
linux permissions: what is the numeric mode of -rwxrwxrw-,776,linux_acl
linux permissions: what is the numeric mode of -rwxrwxrwx,777,linux_acl
+What command sets the default permissions mask?,umask,linux_acl,http://www.computerhope.com/unix/uumask.htm
question.go
@@ -34,12 +34,15 @@ func parseLine(line string) error {
return nil
}
tokens := strings.Split(line, ",")
- if len(tokens) != 3 {
+ if len(tokens) < 3 {
return fmt.Errorf("Unable to parse line for %s", line)
}
record.Question = strings.TrimSpace(tokens[0])
record.Answer = strings.TrimSpace(tokens[1])
category := strings.TrimSpace(strings.ToLower(tokens[2]))
+ if len(tokens) >= 4 {
+ record.Reference = strings.TrimSpace(tokens[3])
+ }
assignCategory(category, &record)
recordMap[category] = append(recordMap[category], record)
return nil
README.md
@@ -32,6 +32,6 @@ USE_HTTPS = false

## CSV Format
-The `csv` files should consist of the fields `question,response,category`. The application reads
-the questions from either a file or recursively from a directory; the behavior depends on the option
-passed under `QUESTIONS` in the `conf` file.
+The `csv` files should consist of the fields `question,response,category,reference`. The `reference`
+is an optional field. The application reads the questions from either a file or recursively from
+a directory; the behavior depends on the option passed under `QUESTIONS` in the `conf` file.
structures.go
@@ -50,6 +50,7 @@ var EXIT_CODE = EXIT_CODES{
// Record stores information related to a single record
type Record struct {
Question,
+ Reference,
Answer string
Category,
ID int