github.com/4thel00z/pcopy@v0.0.0-20230830212547-a1758a3a86bc/main.go (about)

     1  // pcopy is a temporary file host, nopaste and clipboard across machines. It can be used from the
     2  // Web UI, via a CLI or without a client by using curl.
     3  //
     4  // Full documentation with examples and videos can be found at https://github.com/4thel00z/pcopy.
     5  package main
     6  
     7  import (
     8  	"fmt"
     9  	"os"
    10  	"runtime"
    11  
    12  	"github.com/4thel00z/pcopy/cmd"
    13  	"github.com/urfave/cli/v2"
    14  )
    15  
    16  var (
    17  	version = "dev"
    18  	commit  = "unknown"
    19  	date    = "unknown"
    20  )
    21  
    22  func main() {
    23  	cli.AppHelpTemplate += fmt.Sprintf(`
    24  Try 'pcopy COMMAND --help' for more information.
    25  
    26  pcopy %s (%s), runtime %s, built at %s
    27  Copyright (C) 2023 4thel00z, distributed under the Apache License 2.0
    28  `, version, commit[:7], runtime.Version(), date)
    29  
    30  	app := cmd.New()
    31  	app.Version = version
    32  
    33  	if err := cmd.Run(app, os.Args...); err != nil {
    34  		fmt.Fprintln(os.Stderr, err.Error())
    35  		os.Exit(1)
    36  	}
    37  }