/* * flags.go - File which contains all the flags used by the application. This * includes both global flags and command specific flags. When applicable, it * also includes the default values. * * Copyright 2017 Google Inc. * Author: Joe Richey (joerichey@google.com) * * Licensed under the Apache License, Version 2.0 (the "License"); you may not * use this file except in compliance with the License. You may obtain a copy of * the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the * License for the specific language governing permissions and limitations under * the License. */ package main import ( "fmt" "log" "os/user" "regexp" "time" "github.com/google/fscrypt/actions" "github.com/google/fscrypt/cmd" "github.com/google/fscrypt/security" "github.com/google/fscrypt/util" ) // Bool flags: used to switch some behavior on or off var ( legacyFlag = &cmd.BoolFlag{ Name: "legacy", Usage: `Configure fscrypt to support older kernels.`, Default: true, } skipUnlockFlag = &cmd.BoolFlag{ Name: "skip-unlock", Usage: "Leave the directory in a locked state after setup.", } dropCachesFlag = &cmd.BoolFlag{ Name: "drop-caches", Usage: `After purging the keys from the keyring, drop the associated caches for the purge to take effect.`, Default: true, } ) // Option flags: used to specify options instead of being prompted for them var ( timeTargetFlag = &cmd.DurationFlag{ Name: "time", ArgName: "time", Usage: `Set the global options so that passphrase hashing takes