kythe.io@v0.0.68-0.20240422202219-7225dbc01741/kythe/go/platform/tools/kzip/kzip.go (about)

     1  /*
     2   * Copyright 2019 The Kythe Authors. All rights reserved.
     3   *
     4   * Licensed under the Apache License, Version 2.0 (the "License");
     5   * you may not use this file except in compliance with the License.
     6   * You may obtain a copy of the License at
     7   *
     8   *   http://www.apache.org/licenses/LICENSE-2.0
     9   *
    10   * Unless required by applicable law or agreed to in writing, software
    11   * distributed under the License is distributed on an "AS IS" BASIS,
    12   * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    13   * See the License for the specific language governing permissions and
    14   * limitations under the License.
    15   */
    16  
    17  // Binary kzip provides tools to work with kzip archives.
    18  //
    19  // Examples:
    20  //
    21  //	# Merge 5 kzip archives into a single file.
    22  //	kzip merge --output output.kzip in{0,1,2,3,4}.kzip
    23  package main
    24  
    25  import (
    26  	"context"
    27  	"flag"
    28  	"os"
    29  
    30  	"kythe.io/kythe/go/platform/tools/kzip/createcmd"
    31  	"kythe.io/kythe/go/platform/tools/kzip/filtercmd"
    32  	"kythe.io/kythe/go/platform/tools/kzip/infocmd"
    33  	"kythe.io/kythe/go/platform/tools/kzip/mergecmd"
    34  	"kythe.io/kythe/go/platform/tools/kzip/metadatacmd"
    35  	"kythe.io/kythe/go/platform/tools/kzip/viewcmd"
    36  
    37  	"github.com/google/subcommands"
    38  )
    39  
    40  func init() {
    41  	subcommands.Register(createcmd.New(), "")
    42  	subcommands.Register(filtercmd.New(), "")
    43  	subcommands.Register(infocmd.New(), "")
    44  	subcommands.Register(mergecmd.New(), "")
    45  	subcommands.Register(metadatacmd.New(), "")
    46  	subcommands.Register(viewcmd.New(), "")
    47  }
    48  
    49  func main() {
    50  	flag.Parse()
    51  	ctx := context.Background()
    52  
    53  	os.Exit(int(subcommands.Execute(ctx)))
    54  }