Skip to content

Commit

Permalink
commands: move tapcli functionality to a new package
Browse files Browse the repository at this point in the history
Relocate command-line parsing functionality to a new package
called `commands`. This change will eventually enable
integration tests to call into the parsing logic directly.
  • Loading branch information
ffranr committed Jan 21, 2025
1 parent b7b360a commit 1044897
Show file tree
Hide file tree
Showing 15 changed files with 21 additions and 17 deletions.
2 changes: 1 addition & 1 deletion cmd/tapcli/addrs.go → cmd/commands/addrs.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package main
package commands

import (
"encoding/hex"
Expand Down
2 changes: 1 addition & 1 deletion cmd/tapcli/assets.go → cmd/commands/assets.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package main
package commands

import (
"encoding/hex"
Expand Down
2 changes: 1 addition & 1 deletion cmd/tapcli/cmd_profile.go → cmd/commands/cmd_profile.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package main
package commands

import (
"fmt"
Expand Down
2 changes: 1 addition & 1 deletion cmd/tapcli/commands.go → cmd/commands/commands.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package main
package commands

import (
"bytes"
Expand Down
2 changes: 1 addition & 1 deletion cmd/tapcli/conn.go → cmd/commands/conn.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
// Copyright (c) 2015-2016 The Decred developers
// Copyright (C) 2015-2022 The Lightning Network Developers

package main
package commands

import (
"bufio"
Expand Down
2 changes: 1 addition & 1 deletion cmd/tapcli/events.go → cmd/commands/events.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package main
package commands

import (
"encoding/hex"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package main
package commands

import (
"encoding/base64"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package main
package commands

import (
"encoding/hex"
Expand Down
2 changes: 1 addition & 1 deletion cmd/tapcli/profile.go → cmd/commands/profile.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package main
package commands

import (
"bytes"
Expand Down
2 changes: 1 addition & 1 deletion cmd/tapcli/proofs.go → cmd/commands/proofs.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package main
package commands

import (
"encoding/hex"
Expand Down
2 changes: 1 addition & 1 deletion cmd/tapcli/rfq.go → cmd/commands/rfq.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package main
package commands

import (
"fmt"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
//go:build dev

package main
package commands

import (
"fmt"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
//go:build !dev

package main
package commands

import "github.com/urfave/cli"

Expand Down
2 changes: 1 addition & 1 deletion cmd/tapcli/universe.go → cmd/commands/universe.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package main
package commands

import (
"bytes"
Expand Down
10 changes: 7 additions & 3 deletions cmd/tapcli/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,16 @@

package main

import "os"
import (
"os"

"github.com/lightninglabs/taproot-assets/cmd/commands"
)

func main() {
// Set up the main CLI app.
app := NewApp()
app := commands.NewApp()
if err := app.Run(os.Args); err != nil {
Fatal(err)
commands.Fatal(err)
}
}

0 comments on commit 1044897

Please sign in to comment.