~psic4t/qcard

85a8652614cc5185db9afffaf3428525568e13c9 — psic4t 7 months ago e079a4a
enable search without -s
4 files changed, 15 insertions(+), 18 deletions(-)

M README.md
M TODO
M main.go
M qcard
M README.md => README.md +4 -12
@@ 49,21 49,13 @@ This simply displays all contacts from all addressbook:

This only shows contacts from addressbook 0:

    qcard -c 0
    qcard -a 0

This shows all appointments from 01.10.2021, 00:00h to 31.10.2021, 23:59:59
(Note: This is in UTC!):
This displays all avaliable addressbooks with their numbers and colors:

    qcal -s 20211001T000000 -e 20211031T235959
    qcaŕd -l

This displays all avaliable calendars with their numbers and colors:

    qcal -l

### Add new appointment

Even though the abillity to create new appointments is limited, it is easy to
create simple appointment types.
### Add new contact

This creates an appointment on 01.12.2021 from 15:00h to 17:00h with the
summary of "Tea Time":

M TODO => TODO +2 -0
@@ 1,2 1,4 @@
# TODO

- search by organisation
- Mutt integration

M main.go => main.go +9 -6
@@ 8,7 8,7 @@ import (
	"io/ioutil"
	"log"
	"net/http"
	//"os"
	"os"
	"regexp"
	"sort"
	"strconv"


@@ 201,19 201,22 @@ END:VCARD`
}

func main() {
	/*if strings.Contains(os.Args[1], "-") == false {
		fmt.Println(os.Args[1])
	}*/
	toFile := false

	flag.StringVar(&filter, "s", "", "Search term")
	flag.StringVar(&filter, "s", os.Args[1], "Search term")
	//flag.BoolVar(&showInfo, "i", false, "Show additional info like description and location for contacts")
	flag.BoolVar(&showFilename, "f", false, "Show contact filename for editing or deletion")
	flag.BoolVar(&displayFlag, "p", false, "Print VCF file piped to qcard (for CLI mail tools like mutt)")
	abNumber := flag.String("a", "all", "Show only single addressbook (number)")
	version := flag.Bool("v", false, "Show version")
	showAddressbooks := flag.Bool("l", false, "List configured addressbooks with their corresponding numbers (for \"-c\")")
	showAddressbooks := flag.Bool("l", false, "List configured addressbooks with their corresponding numbers (for \"-a\")")
	contactFile := flag.String("u", "", "Upload contact file. Provide filename and use with \"-c\"")
	contactDelete := flag.String("delete", "", "Delete contact. Get filename with \"-f\" and use with \"-c\"")
	contactDump := flag.String("d", "", "Dump raw contact data. Get filename with \"-f\" and use with \"-c\"")
	contactEdit := flag.String("edit", "", "Edit + upload contact data. Get filename with \"-f\" and use with \"-c\"")
	contactDelete := flag.String("delete", "", "Delete contact. Get filename with \"-f\" and use with \"-a\"")
	contactDump := flag.String("d", "", "Dump raw contact data. Get filename with \"-f\" and use with \"-a\"")
	contactEdit := flag.String("edit", "", "Edit + upload contact data. Get filename with \"-f\" and use with \"-a\"")
	contactNew := flag.String("n", "", "Add a new contact. Check README.md for syntax")
	flag.Parse()
	flagset := make(map[string]bool) // map for flag.Visit. get bools to determine set flags

M qcard => qcard +0 -0