Merge pull request #1215 from zhengzhijiej-tech/fix/delete-value-render-option

fix(sheets): drop dead --value-render-option flag from +csv-get
This commit is contained in:
zhengzhijiej-tech
2026-06-02 15:00:26 +08:00
committed by GitHub
6 changed files with 3 additions and 33 deletions

View File

@@ -1187,19 +1187,6 @@
"required": "required",
"desc": "A1 range, e.g. `A1:F30` (no sheet prefix — use `--sheet-id` / `--sheet-name` to select the sheet)"
},
{
"name": "value-render-option",
"kind": "own",
"type": "string",
"required": "optional",
"desc": "Cell value render mode",
"default": "formatted_value",
"enum": [
"formatted_value",
"raw_value",
"formula"
]
},
{
"name": "max-chars",
"kind": "own",

View File

@@ -183,9 +183,6 @@ func csvGetInput(runtime *common.RuntimeContext, token, sheetID, sheetName strin
if r := strings.TrimSpace(runtime.Str("range")); r != "" {
input["range"] = r
}
if v := runtime.Str("value-render-option"); v != "" {
input["value_render_option"] = v
}
if runtime.Bool("skip-hidden") {
input["skip_hidden"] = true
}

View File

@@ -34,19 +34,6 @@ func TestReadDataShortcuts_DryRun(t *testing.T) {
"cell_limit": float64(unboundedReadLimit), // pinned high; --max-chars is the only cap
},
},
{
name: "+csv-get with value-render-option",
sc: CsvGet,
args: []string{"--url", testURL, "--sheet-id", testSheetID, "--range", "A1:C10", "--value-render-option", "formula"},
toolName: "get_range_as_csv",
wantInput: map[string]interface{}{
"excel_id": testToken,
"sheet_id": testSheetID,
"range": "A1:C10",
"value_render_option": "formula",
"max_rows": float64(unboundedReadLimit), // pinned high; --max-chars is the only cap
},
},
{
// Canonical form: --sheet-id + bare --range. Aligned with
// +cells-get / +csv-get; before the e2e BUG-019 fix this

View File

@@ -39,7 +39,7 @@ metadata:
| 你要做的事 | ✅ 正确写法 | ❌ 不存在(会被 cobra 拒) |
| --- | --- | --- |
| 读数据(纯值 / CSV | `+csv-get`(范围用 `--range` | — |
| 读值 + 公式 / 样式 / 批注 | `+cells-get --include value,formula,style,comment,data_validation` | `--value-render-option``--with-styles``--with-merges``--include-merged-cells` |
| 读值 + 公式 / 样式 / 批注 | `+cells-get --include value,formula,style,comment,data_validation` | `--with-styles``--with-merges``--include-merged-cells` |
| 写纯值(整块 CSV 平铺) | `+csv-put`(定位用 `--start-cell`,单个左上角锚点格;也接受 `--range` 别名,区间自动取左上角) | — |
| 写值 / 公式 / 样式 | `+cells-set`(定位用 `--range` | — |
| 查找单元格 | `+cells-search`(关键字用 `--find` | `+cells-find``+find``--query` |
@@ -53,7 +53,7 @@ metadata:
| 分组汇总 / 透视 | `+pivot-create`(默认不传落点 flag → 自动新建子表,零覆盖) | 用 SUMIF / 本地脚本拼一张假透视表 |
> ⚠️ **定位 flag**`+cells-get` / `+cells-set` / `+csv-get` 用 `--range``+csv-put` 规范用 `--start-cell`(单个左上角锚点格),也接受 `--range` 别名(区间自动取左上角),二者择一即可。
> ⚠️ **读取附加信息**一律走 `+cells-get --include …`**没有** `--value-render-option` / `--with-styles` 这类 flag**看合并单元格**用 `+sheet-info` 的 `merged_cells`,不要在 `+cells-get` 里找 merge flag。
> ⚠️ **读取附加信息**一律走 `+cells-get --include …`**没有** `--with-styles` 这类 flag**看合并单元格**用 `+sheet-info` 的 `merged_cells`,不要在 `+cells-get` 里找 merge flag。
## References

View File

@@ -69,7 +69,7 @@
**硬性流程**
1. sort 前先用 `+csv-get` 抽样目标列的前 35 行,或用 `+cells-get``--value-render-option raw_value` 看原始值;默认 `formatted_value` 返回显示值)确认原始值形态,不要只看列名和用户问题就直接排。
1. sort 前先用 `+csv-get` 抽样目标列的前 35 行确认原始值形态,不要只看列名和用户问题就直接排。
2. 若是纯数字或日期 → 直接 sort。
3. 若是带符号 / 表达式 / 单位的文本 → **不要直接排**
- 简单场景(货币、千分位、单位前缀):新增辅助列,用公式提取数值(如 `=VALUE(SUBSTITUTE(SUBSTITUTE(A2,"¥",""),",",""))`),按辅助列排序,排完可按需清除辅助列。

View File

@@ -112,7 +112,6 @@ _公共四件套 · 系统:`--dry-run`_
| Flag | Type | 必填 | 说明 |
| --- | --- | --- | --- |
| `--range` | string | required | A1 范围,如 `A1:F30`(不带 sheet 前缀;用 `--sheet-id` / `--sheet-name` 指定 sheet |
| `--value-render-option` | string | optional | 单元格取值模式(可选值:`formatted_value` / `raw_value` / `formula`)(默认 `formatted_value` |
| `--max-chars` | int | optional | 防爆,默认 200000隐藏 flag不在 `--help` 列出,但可正常传入) |
| `--include-row-prefix` | bool | optional | 是否在每行前加 `[row=N]` 前缀,默认 `true` |
| `--skip-hidden` | bool | optional | 跳过隐藏行列,默认 `false` |