refactor: Move stbak command to root

This commit is contained in:
Felicitas Pojtinger
2021-12-19 18:29:33 +01:00
parent 535cb0c97e
commit 9f06a5fa4b
25 changed files with 15 additions and 15 deletions

View File

@@ -1,6 +1,6 @@
# stfs
# STFS
Simple Tape File System, a FUSE based on tar and SQLite for tape drives.
Simple Tape File System (STFS), a file system for tapes and tar files.
## Overview
@@ -8,6 +8,6 @@ Simple Tape File System, a FUSE based on tar and SQLite for tape drives.
## License
stfs (c) 2021 Felicitas Pojtinger and contributors
STFS (c) 2021 Felicitas Pojtinger and contributors
SPDX-License-Identifier: AGPL-3.0

View File

@@ -25,14 +25,14 @@ const (
)
var rootCmd = &cobra.Command{
Use: "stbak",
Short: "Simple Tape Backup",
Long: `Simple Tape Backup (stbak) is a CLI to interact with STFS-managed tapes, tar files and indexes.
Use: "stfs",
Short: "Simple Tape File System",
Long: `Simple Tape File System (STFS) is a file system for tapes and tar files.
Find more information at:
https://github.com/pojntfx/stfs`,
PersistentPreRunE: func(cmd *cobra.Command, args []string) error {
viper.SetEnvPrefix("stbak")
viper.SetEnvPrefix("stfs")
viper.SetEnvKeyReplacer(strings.NewReplacer("-", "_", ".", "_"))
if err := viper.BindPFlags(cmd.PersistentFlags()); err != nil {
@@ -61,7 +61,7 @@ func Execute() {
if err != nil {
panic(err)
}
metadataPath := filepath.Join(home, ".local", "share", "stbak", "var", "lib", "stbak", "metadata.sqlite")
metadataPath := filepath.Join(home, ".local", "share", "stfs", "var", "lib", "stfs", "metadata.sqlite")
rootCmd.PersistentFlags().StringP(driveFlag, "d", "/dev/nst0", "Tape or tar file to use")
rootCmd.PersistentFlags().StringP(metadataFlag, "m", metadataPath, "Metadata database to use")

View File

@@ -1,7 +0,0 @@
package main
import "github.com/pojntfx/stfs/cmd/stbak/cmd"
func main() {
cmd.Execute()
}

7
main.go Normal file
View File

@@ -0,0 +1,7 @@
package main
import "github.com/pojntfx/stfs/cmd"
func main() {
cmd.Execute()
}