From f23c3dd5290e08591fc24a72dfbfcbc71c5be443 Mon Sep 17 00:00:00 2001 From: Shulhan Date: Mon, 4 Jun 2018 00:04:20 +0700 Subject: cmd/beku/main: set command manual to reference to README on repository It's hard and error prone to maintains two equal text. --- cmd/beku/main.go | 156 +------------------------------------------------------ 1 file changed, 2 insertions(+), 154 deletions(-) diff --git a/cmd/beku/main.go b/cmd/beku/main.go index 8b1bc5d..512cd42 100644 --- a/cmd/beku/main.go +++ b/cmd/beku/main.go @@ -6,161 +6,9 @@ // Beku is a command line program to manage packages in user's environment // (GOPATH or vendor) directory. Beku provide syntax like `pacman`. // -// Beku read and write the package database into a file named "beku.db". +// See README in root of this repository for user manual [1]. // -// At first execution, beku will try to open the package database in current -// directory. If no file found, it will try to open -// "{prefix}/var/beku/beku.db". When both locations does not provide -// package database, beku will scan entire "{prefix}/src" and write the -// package database into "{prefix}/var/beku/beku.db". -// -// ## Global Options -// -// --noconfirm -// -// No confirmation will be asked on any operation. Useful when running beku -// inside a script. -// -// -V, --vendor -// -// Operate in vendor mode. This option used only when first scanning -// (`beku -V -S`). -// Any operation after that, will use the "vendor" directory in current -// working directory as installation prefix. -// -// ## Freeze Operation -// -// -B, --freeze -// -// Operate on the package database and user's environment. This operation will -// ensure that all packages listed on database file is installed with their -// specific version. Also, all packages that are not registered -// will be removed from "src" and "pkg" directories. -// -// ## Database Operation -// -// -D, --database -// -// Modify the package database. This operation required one of the options -// below. -// -// ### Options -// -// -e, --exclude -// -// Remove list of package by import path from database and add mark it as -// excluded package. Excluded package will be ignored on future operations. -// -// ### Examples -// -// $ beku -De github.com/shuLhan/beku -// -// Exclude package "github.com/shuLhan/beku" from future scanning, -// installation, or removal. -// -// -// ## Query Operation -// -// -Q, --query [pkg ...] -// -// Query the package database. -// -// ## Remove Operation -// -// -R, --remove -// -// Remove package from environment, including source and installed binaries -// and archives. -// -// ### Options -// -// [-s,--recursive] -// -// Also remove all target dependencies, as long as is not required by other -// packages. -// -// ### Examples -// -// $ beku -R github.com/shuLhan/beku -// -// Remove package "github.com/shuLhan/beku" source in "{prefix}/src", -// their installed binaries in "{prefix}/bin", and their installed archives on -// "{prefix}/pkg/{GOOS}_{GOARCH}". -// -// $ beku -R github.com/shuLhan/beku --recursive -// $ beku -Rs github.com/shuLhan/beku -// -// Remove package "github.com/shuLhan/beku" source in "{prefix}/src", -// their installed binaries in "{prefix}/bin", their installed archives on -// "{prefix}/pkg/{GOOS}_{GOARCH}", and all their dependencies. -// -// -// ## Sync Operation -// -// -S, --sync -// -// Synchronizes package. Given a package import path, beku will try to clone -// the package into source directory and set the package version to -// latest the tag. If no tag found, it will use the latest commit on master -// branch. A specific version can be set using "@version" suffix. -// -// If package already exist, it will reset the HEAD to the version that is set -// on database file. -// -// If no parameter is given, beku will do a rescan, checking for new packages. -// -// ### Options -// -// [--into ] -// -// This option will install the package import path into custom directory. -// It is useful if you have the fork of the main package but want to install -// it to the legacy directory. -// -// [-u,--update] -// -// Fetch new tag or commit from remote repository. User will be asked for -// confirmation before upgrade. -// -// ### Examples -// -// $ beku -S golang.org/x/text -// -// Download package `golang.org/x/text` into `{prefix}/src/golang.org/x/text`, -// and set their version to the latest commit on branch master. -// -// $ beku -S github.com/golang/text --into golang.org/x/text -// -// Download package `github.com/golang/text` into -// `{prefix}/src/golang.org/x/text`, and set their version to the latest commit -// on branch master. -// -// $ beku -S golang.org/x/text@v0.3.0 -// -// Download package `golang.org/x/text` into `{prefix}/src/golang.org/x/text` -// and checkout the tag `v0.3.0` as the working version. -// -// $ beku -S golang.org/x/text@5c1cf69 -// -// Download package `golang.org/x/text` into `{prefix}/src/golang.org/x/text` -// and checkout the commit `5c1cf69` as the working version. -// -// $ beku -Su -// -// Update all packages in database to new tag or commits with approval from -// user. -// -// # Known Limitations -// -// * Only work with package hosted with Git on HTTPS or SSH. -// -// * Tested only on package hosted on Github. -// -// * Tested only on Git v2.17 or greater -// -// # References -// -// [1] https://www.archlinux.org/pacman/ +// [1] https://github.com/shuLhan/beku // package main -- cgit v1.3