mirror of
https://github.com/rwinkhart/MUTN.git
synced 2026-09-05 08:37:20 -04:00
Initial read shortcut support (target status checking)
This commit is contained in:
@@ -1,9 +1,11 @@
|
||||
package main
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"github.com/rwinkhart/MUTN/src/cli"
|
||||
"github.com/rwinkhart/MUTN/src/offline"
|
||||
"os"
|
||||
"strings"
|
||||
)
|
||||
|
||||
func main() {
|
||||
@@ -17,6 +19,17 @@ func main() {
|
||||
|
||||
} else if argsCount == 1 {
|
||||
|
||||
// initial entry reader shortcut
|
||||
// TODO Do not use file extensions for entries! This will allow doing this check more efficiently than otherwise possible.
|
||||
if strings.HasPrefix(args[0], "/") {
|
||||
if isFile, _ := offline.TargetIsFile(offline.EntryRoot+args[0], true); isFile {
|
||||
fmt.Println("It's a file!")
|
||||
} else {
|
||||
fmt.Println("It's a directory!")
|
||||
}
|
||||
os.Exit(0)
|
||||
}
|
||||
|
||||
switch args[0] {
|
||||
|
||||
case "help", "--help", "-h":
|
||||
|
||||
Reference in New Issue
Block a user