Slightly modified various use cases of "cellname" so that they
behave as one would expect; e.g., "cellname self" returns the name of the currently edited cell if nothing is selected; "cellname rename <name>" renames the currently edited cell to <name>. Modified the "extract" command so that it will not extract a cell named "(UNNAMED)" but will insist that the cell must be given a proper name, much like the "writeall" command does.
This commit is contained in:
parent
021e9b5eec
commit
8957d4b947
|
|
@ -1167,7 +1167,7 @@ CmdCellname(w, cmd)
|
||||||
TxError("Unknown cell %s\n", cellname);
|
TxError("Unknown cell %s\n", cellname);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
if (locargc == 3)
|
if (locargc <= 3)
|
||||||
{
|
{
|
||||||
if (cellDef->cd_file == NULL)
|
if (cellDef->cd_file == NULL)
|
||||||
{
|
{
|
||||||
|
|
@ -1280,7 +1280,15 @@ CmdCellname(w, cmd)
|
||||||
break;
|
break;
|
||||||
case IDX_RENAME:
|
case IDX_RENAME:
|
||||||
/* Rename the cell and mark as modified. Do not write to disk. */
|
/* Rename the cell and mark as modified. Do not write to disk. */
|
||||||
if (locargc != 4) goto badusage;
|
if ((locargc == 3) && (EditRootDef != NULL))
|
||||||
|
{
|
||||||
|
/* Assume cellname is the target name, and the current */
|
||||||
|
/* cell is the one to have its name changed. */
|
||||||
|
cellDef = EditRootDef;
|
||||||
|
DBCellRename(cellDef->cd_name, cellname, doforce);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
else if (locargc != 4) goto badusage;
|
||||||
DBCellRename(cellname, cmd->tx_argv[3 + ((dolist) ? 1 : 0)], doforce);
|
DBCellRename(cellname, cmd->tx_argv[3 + ((dolist) ? 1 : 0)], doforce);
|
||||||
break;
|
break;
|
||||||
case IDX_CREATE:
|
case IDX_CREATE:
|
||||||
|
|
|
||||||
|
|
@ -1012,7 +1012,10 @@ CmdExtract(w, cmd)
|
||||||
|
|
||||||
if (argc == 1)
|
if (argc == 1)
|
||||||
{
|
{
|
||||||
ExtIncremental(selectedUse);
|
if (!strcmp(selectedUse->cu_def->cd_name, UNNAMED))
|
||||||
|
TxError("Please name the cell before extracting.\n");
|
||||||
|
else
|
||||||
|
ExtIncremental(selectedUse);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -1043,7 +1046,10 @@ CmdExtract(w, cmd)
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case EXTALL:
|
case EXTALL:
|
||||||
ExtAll(selectedUse);
|
if (!strcmp(selectedUse->cu_def->cd_name, UNNAMED))
|
||||||
|
TxError("Please name the cell before extracting.\n");
|
||||||
|
else
|
||||||
|
ExtAll(selectedUse);
|
||||||
return;
|
return;
|
||||||
|
|
||||||
case EXTCELL:
|
case EXTCELL:
|
||||||
|
|
@ -1065,7 +1071,10 @@ CmdExtract(w, cmd)
|
||||||
TxError("No cell selected\n");
|
TxError("No cell selected\n");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
ExtParents(selectedUse);
|
if (!strcmp(selectedUse->cu_def->cd_name, UNNAMED))
|
||||||
|
TxError("Please name the cell before extracting.\n");
|
||||||
|
else
|
||||||
|
ExtParents(selectedUse);
|
||||||
return;
|
return;
|
||||||
|
|
||||||
case EXTSHOWPARENTS:
|
case EXTSHOWPARENTS:
|
||||||
|
|
|
||||||
|
|
@ -871,8 +871,17 @@ DBCellPrint(CellName, who, dolist)
|
||||||
}
|
}
|
||||||
if (found == 0)
|
if (found == 0)
|
||||||
{
|
{
|
||||||
if (!dolist)
|
if (EditRootDef == NULL)
|
||||||
TxPrintf("No cells selected.\n");
|
{
|
||||||
|
if (!dolist)
|
||||||
|
TxPrintf("No cells selected.\n");
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
dbCellPrintInfo(EditRootDef, who, dolist);
|
||||||
|
found = 1;
|
||||||
|
break;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue