use urfave/cli/v2

pull/150/head^2
Yasuhiro Matsumoto 2022-11-27 13:24:42 +09:00
parent 5f0c9a21c2
commit b597f437a9
No known key found for this signature in database
GPG Key ID: 622DE34DC490584B
32 changed files with 49 additions and 50 deletions

View File

@ -5,7 +5,7 @@ import (
"fmt"
"github.com/mattn/go-mastodon"
"github.com/urfave/cli"
"github.com/urfave/cli/v2"
)
func cmdAccount(c *cli.Context) error {

View File

@ -6,7 +6,7 @@ import (
"strings"
"testing"
"github.com/urfave/cli"
"github.com/urfave/cli/v2"
)
func TestCmdAccount(t *testing.T) {

View File

@ -5,7 +5,7 @@ import (
"errors"
"github.com/mattn/go-mastodon"
"github.com/urfave/cli"
"github.com/urfave/cli/v2"
)
func cmdDelete(c *cli.Context) error {

View File

@ -5,7 +5,7 @@ import (
"net/http"
"testing"
"github.com/urfave/cli"
"github.com/urfave/cli/v2"
)
func TestCmdDelete(t *testing.T) {

View File

@ -5,7 +5,7 @@ import (
"errors"
"github.com/mattn/go-mastodon"
"github.com/urfave/cli"
"github.com/urfave/cli/v2"
)
func cmdFollow(c *cli.Context) error {

View File

@ -5,7 +5,7 @@ import (
"net/http"
"testing"
"github.com/urfave/cli"
"github.com/urfave/cli/v2"
)
func TestCmdFollow(t *testing.T) {

View File

@ -6,7 +6,7 @@ import (
"time"
"github.com/mattn/go-mastodon"
"github.com/urfave/cli"
"github.com/urfave/cli/v2"
)
func cmdFollowers(c *cli.Context) error {

View File

@ -6,7 +6,7 @@ import (
"strings"
"testing"
"github.com/urfave/cli"
"github.com/urfave/cli/v2"
)
func TestCmdFollowers(t *testing.T) {

View File

@ -6,7 +6,7 @@ import (
"sort"
"github.com/mattn/go-mastodon"
"github.com/urfave/cli"
"github.com/urfave/cli/v2"
)
func cmdInstance(c *cli.Context) error {

View File

@ -5,7 +5,7 @@ import (
"fmt"
"github.com/mattn/go-mastodon"
"github.com/urfave/cli"
"github.com/urfave/cli/v2"
)
func cmdInstanceActivity(c *cli.Context) error {

View File

@ -5,7 +5,7 @@ import (
"fmt"
"github.com/mattn/go-mastodon"
"github.com/urfave/cli"
"github.com/urfave/cli/v2"
)
func cmdInstancePeers(c *cli.Context) error {

View File

@ -6,7 +6,7 @@ import (
"strings"
"testing"
"github.com/urfave/cli"
"github.com/urfave/cli/v2"
)
func TestCmdInstance(t *testing.T) {

View File

@ -1,7 +1,7 @@
package main
import (
"github.com/urfave/cli"
"github.com/urfave/cli/v2"
)
func cmdMikami(c *cli.Context) error {

View File

@ -7,7 +7,7 @@ import (
"strings"
"testing"
"github.com/urfave/cli"
"github.com/urfave/cli/v2"
)
func TestCmdMikami(t *testing.T) {

View File

@ -6,7 +6,7 @@ import (
"github.com/fatih/color"
"github.com/mattn/go-mastodon"
"github.com/urfave/cli"
"github.com/urfave/cli/v2"
)
func cmdNotification(c *cli.Context) error {

View File

@ -6,7 +6,7 @@ import (
"strings"
"testing"
"github.com/urfave/cli"
"github.com/urfave/cli/v2"
)
func TestCmdNotification(t *testing.T) {

View File

@ -6,7 +6,7 @@ import (
"fmt"
"github.com/mattn/go-mastodon"
"github.com/urfave/cli"
"github.com/urfave/cli/v2"
)
func cmdSearch(c *cli.Context) error {

View File

@ -6,7 +6,7 @@ import (
"strings"
"testing"
"github.com/urfave/cli"
"github.com/urfave/cli/v2"
)
func TestCmdSearch(t *testing.T) {

View File

@ -10,7 +10,7 @@ import (
"text/template"
"github.com/mattn/go-mastodon"
"github.com/urfave/cli"
"github.com/urfave/cli/v2"
)
// SimpleJSON is a struct for output JSON for data to be simple used

View File

@ -6,7 +6,7 @@ import (
"net/http/httptest"
"github.com/mattn/go-mastodon"
"github.com/urfave/cli"
"github.com/urfave/cli/v2"
)
func testWithServer(h http.HandlerFunc, testFuncs ...func(*cli.App)) string {

View File

@ -4,7 +4,7 @@ import (
"context"
"github.com/mattn/go-mastodon"
"github.com/urfave/cli"
"github.com/urfave/cli/v2"
)
func cmdTimeline(c *cli.Context) error {

View File

@ -6,7 +6,7 @@ import (
"strings"
"testing"
"github.com/urfave/cli"
"github.com/urfave/cli/v2"
)
func TestCmdTimeline(t *testing.T) {

View File

@ -6,7 +6,7 @@ import (
"fmt"
"github.com/mattn/go-mastodon"
"github.com/urfave/cli"
"github.com/urfave/cli/v2"
)
func cmdToot(c *cli.Context) error {

View File

@ -5,7 +5,7 @@ import (
"net/http"
"testing"
"github.com/urfave/cli"
"github.com/urfave/cli/v2"
)
func TestCmdToot(t *testing.T) {

View File

@ -6,7 +6,7 @@ import (
"fmt"
"github.com/mattn/go-mastodon"
"github.com/urfave/cli"
"github.com/urfave/cli/v2"
)
func cmdUpload(c *cli.Context) error {

View File

@ -6,7 +6,7 @@ import (
"strings"
"testing"
"github.com/urfave/cli"
"github.com/urfave/cli/v2"
)
func TestCmdUpload(t *testing.T) {

View File

@ -6,7 +6,7 @@ import (
"net/url"
"github.com/PuerkitoBio/goquery"
"github.com/urfave/cli"
"github.com/urfave/cli/v2"
)
func cmdXSearch(c *cli.Context) error {

View File

@ -8,7 +8,7 @@ import (
"strings"
"testing"
"github.com/urfave/cli"
"github.com/urfave/cli/v2"
)
func TestCmdXSearch(t *testing.T) {

View File

@ -9,6 +9,7 @@ require (
github.com/fatih/color v1.13.0
github.com/mattn/go-mastodon v0.0.4
github.com/mattn/go-tty v0.0.4
github.com/urfave/cli v1.22.9
github.com/urfave/cli v1.13.0
github.com/urfave/cli/v2 v2.23.5 // indirect
golang.org/x/net v0.0.0-20220531201128-c960675eff93
)

View File

@ -1,9 +1,8 @@
github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU=
github.com/BurntSushi/toml v1.2.1/go.mod h1:CxXYINrC8qIiEnFrOxCa7Jy5BFHlXnUU2pbicEuybxQ=
github.com/PuerkitoBio/goquery v1.8.0 h1:PJTF7AmFCFKk1N6V6jmKfrNH9tV5pNE6lZMkG0gta/U=
github.com/PuerkitoBio/goquery v1.8.0/go.mod h1:ypIiRMtY7COPGk+I/YbZLbxsxn9g5ejnI2HSMtkjZvI=
github.com/andybalholm/cascadia v1.3.1 h1:nhxRkql1kdYCc8Snf7D5/D3spOX+dBgjA6u8x004T2c=
github.com/andybalholm/cascadia v1.3.1/go.mod h1:R4bJ1UQfqADjvDa4P6HZHLh/3OxWWEqc0Sk8XGwHqvA=
github.com/cpuguy83/go-md2man/v2 v2.0.0-20190314233015-f79a8a8ca69d/go.mod h1:maD7wRr/U5Z6m/iR4s+kqSMx2CaBsrgA7czyZG/E6dU=
github.com/cpuguy83/go-md2man/v2 v2.0.2 h1:p1EgwI/C7NhT0JmVkwCD2ZBK8j4aeHQX2pMHHBfMQ6w=
github.com/cpuguy83/go-md2man/v2 v2.0.2/go.mod h1:tgQtvFlXSQOSOSIRvRPT7W67SCa46tRHOmNcaadrF8o=
github.com/fatih/color v1.13.0 h1:8LOYc1KYPPmyKMuN8QV2DNRWNbLo6LZ0iLs8+mlH53w=
@ -11,9 +10,8 @@ github.com/fatih/color v1.13.0/go.mod h1:kLAiJbzzSOZDVNGyDpeOxJ47H46qBXwg5ILebYF
github.com/gorilla/websocket v1.5.0 h1:PPwGk2jz7EePpoHN/+ClbZu8SPxiqlu12wZP/3sWmnc=
github.com/gorilla/websocket v1.5.0/go.mod h1:YR8l580nyteQvAITg2hZ9XVh4b55+EU/adAjf1fMHhE=
github.com/mattn/go-colorable v0.1.4/go.mod h1:U0ppj6V5qS13XJ6of8GYAs25YV2eR4EVcfRqFIhoBtE=
github.com/mattn/go-colorable v0.1.9 h1:sqDoxXbdeALODt0DAeJCVp38ps9ZogZEAXjus69YV3U=
github.com/mattn/go-colorable v0.1.9/go.mod h1:u6P/XSegPjTcexA+o6vUJrdnUu04hMope9wVRipJSqc=
github.com/mattn/go-colorable v0.1.12 h1:jF+Du6AlPIjs2BiUiQlKOX0rt3SujHxPnksPKZbaA40=
github.com/mattn/go-colorable v0.1.12/go.mod h1:u5H1YNBxpqRaxsYJYSkiCWKzEfiAb1Gb520KVy5xxl4=
github.com/mattn/go-isatty v0.0.8/go.mod h1:Iq45c/XA43vh69/j3iqttzPXn0bhXyGjM0Hdxcsrc5s=
github.com/mattn/go-isatty v0.0.10/go.mod h1:qgIWMr58cqv1PHHyhnkY9lrL7etaEgOFcMEpPG5Rm84=
github.com/mattn/go-isatty v0.0.12/go.mod h1:cbi8OIDigv2wuxKPP5vlRcQ1OAZbq2CE4Kysco4FUpU=
@ -22,15 +20,16 @@ github.com/mattn/go-isatty v0.0.14/go.mod h1:7GGIvUiUoEMVVmxf/4nioHXj79iQHKdU27k
github.com/mattn/go-runewidth v0.0.7/go.mod h1:H031xJmbD/WCDINGzjvQ9THkh0rPKHF+m2gUSrubnMI=
github.com/mattn/go-tty v0.0.4 h1:NVikla9X8MN0SQAqCYzpGyXv0jY7MNl3HOWD2dkle7E=
github.com/mattn/go-tty v0.0.4/go.mod h1:u5GGXBtZU6RQoKV8gY5W6UhMudbR5vXnUe7j3pxse28=
github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4=
github.com/russross/blackfriday/v2 v2.0.1/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM=
github.com/russross/blackfriday/v2 v2.1.0 h1:JIOH55/0cWyOuilr9/qlrm0BSXldqnqwMsf35Ld67mk=
github.com/russross/blackfriday/v2 v2.1.0/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM=
github.com/shurcooL/sanitized_anchor_name v1.0.0/go.mod h1:1NzhyTcUVG4SuEtjjoZeVRXNmyL/1OwPU0+IJeTBvfc=
github.com/tomnomnom/linkheader v0.0.0-20180905144013-02ca5825eb80 h1:nrZ3ySNYwJbSpD6ce9duiP+QkD3JuLCcWkdaehUS/3Y=
github.com/tomnomnom/linkheader v0.0.0-20180905144013-02ca5825eb80/go.mod h1:iFyPdL66DjUD96XmzVL3ZntbzcflLnznH0fr99w5VqE=
github.com/urfave/cli v1.22.9 h1:cv3/KhXGBGjEXLC4bH0sLuJ9BewaAbpk5oyMOveu4pw=
github.com/urfave/cli v1.22.9/go.mod h1:Gos4lmkARVdJ6EkW0WaNv/tZAAMe9V7XWyB60NtXRu0=
github.com/urfave/cli v1.13.0 h1:kkpCmfxnnnWIie2rCljcvaVrNYmsFq1ynTJH5kn1Ip4=
github.com/urfave/cli v1.13.0/go.mod h1:70zkFmudgCuE/ngEzBv17Jvp/497gISqfk5gWijbERA=
github.com/urfave/cli/v2 v2.23.5 h1:xbrU7tAYviSpqeR3X4nEFWUdB/uDZ6DE+HxmRU7Xtyw=
github.com/urfave/cli/v2 v2.23.5/go.mod h1:GHupkWPMM0M/sj1a2b4wUrWBPzazNrIjouW6fmdJLxc=
github.com/xrash/smetrics v0.0.0-20201216005158-039620a65673 h1:bAn7/zixMGCfxrRTfdpNzjtPYqr8smhKouy9mxVdGPU=
github.com/xrash/smetrics v0.0.0-20201216005158-039620a65673/go.mod h1:N3UwUGtsrSj3ccvlPHLoLsHnpR27oXr4ZE984MbSER8=
golang.org/x/net v0.0.0-20210916014120-12bc252f5db8/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y=
golang.org/x/net v0.0.0-20220531201128-c960675eff93 h1:MYimHLfoXEpOhqd/zgoA/uoXzHB86AEky4LAx5ij9xA=
golang.org/x/net v0.0.0-20220531201128-c960675eff93/go.mod h1:XRhObCWvk6IyKnWLug+ECip1KBveYUHfp+8e9klMJ9c=
@ -43,7 +42,6 @@ golang.org/x/sys v0.0.0-20201119102817-f84b799fce68/go.mod h1:h1NjWce9XRLGQEsW7w
golang.org/x/sys v0.0.0-20210423082822-04245dca01da/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20210615035016-665e8c7367d1/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.0.0-20210630005230-0f9fa26af87c/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.0.0-20210927094055-39ccf1dd6fa6/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.0.0-20220520151302-bc2c85ada10a h1:dGzPydgVsqGcTRVwiLJ1jVbufYwmzD3LfVPLKsKg+0k=
golang.org/x/sys v0.0.0-20220520151302-bc2c85ada10a/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo=
@ -52,4 +50,4 @@ golang.org/x/text v0.3.6/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ=
golang.org/x/text v0.3.7/go.mod h1:u+2+/6zg+i71rQMx5EYifcz6MCKuco9NR6JIITiCfzQ=
golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ=
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
gopkg.in/yaml.v2 v2.2.2/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=

View File

@ -17,7 +17,7 @@ import (
"github.com/fatih/color"
"github.com/mattn/go-mastodon"
"github.com/mattn/go-tty"
"github.com/urfave/cli"
"github.com/urfave/cli/v2"
"golang.org/x/net/html"
)
@ -183,23 +183,23 @@ func makeApp() *cli.App {
app.Usage = "mastodon client"
app.Version = "0.0.1"
app.Flags = []cli.Flag{
cli.StringFlag{
&cli.StringFlag{
Name: "profile",
Usage: "profile name",
Value: "",
},
}
app.Commands = []cli.Command{
app.Commands = []*cli.Command{
{
Name: "toot",
Usage: "post toot",
Flags: []cli.Flag{
cli.StringFlag{
&cli.StringFlag{
Name: "ff",
Usage: "post utf-8 string from a file(\"-\" means STDIN)",
Value: "",
},
cli.StringFlag{
&cli.StringFlag{
Name: "i",
Usage: "in-reply-to",
Value: "",
@ -211,19 +211,19 @@ func makeApp() *cli.App {
Name: "stream",
Usage: "stream statuses",
Flags: []cli.Flag{
cli.StringFlag{
&cli.StringFlag{
Name: "type",
Usage: "stream type (public,public/local,user:NAME,hashtag:TAG)",
},
cli.BoolFlag{
&cli.BoolFlag{
Name: "json",
Usage: "output JSON",
},
cli.BoolFlag{
&cli.BoolFlag{
Name: "simplejson",
Usage: "output simple JSON",
},
cli.StringFlag{
&cli.StringFlag{
Name: "template",
Usage: "output with tamplate format",
},

View File

@ -7,7 +7,7 @@ import (
"os"
"testing"
"github.com/urfave/cli"
"github.com/urfave/cli/v2"
)
func TestReadFileFile(t *testing.T) {